From 5f583b068070d0b5b6c434c41c1f59e9d6464cd2 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 27 Nov 2022 06:27:51 -0500 Subject: [PATCH] Fix clang warning from previous commits. --- src/V3Dfg.h | 8 +++++--- src/V3File.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/V3Dfg.h b/src/V3Dfg.h index 247a177b3..5d86805f8 100644 --- a/src/V3Dfg.h +++ b/src/V3Dfg.h @@ -101,13 +101,15 @@ class DfgGraph final { DfgGraph* m_graphp; // The referenced graph public: - explicit UserDataInUse(DfgGraph* graphp) + // cppcheck-suppress noExplicitConstructor + UserDataInUse(DfgGraph* graphp) : m_graphp{graphp} {} - VL_UNCOPYABLE(UserDataInUse); - explicit UserDataInUse(UserDataInUse&& that) { + // cppcheck-suppress noExplicitConstructor + UserDataInUse(UserDataInUse&& that) { UASSERT(that.m_graphp, "Moving from empty"); m_graphp = vlstd::exchange(that.m_graphp, nullptr); } + VL_UNCOPYABLE(UserDataInUse); UserDataInUse& operator=(UserDataInUse&& that) { UASSERT(that.m_graphp, "Moving from empty"); m_graphp = vlstd::exchange(that.m_graphp, nullptr); diff --git a/src/V3File.h b/src/V3File.h index db1104ae2..ba2b5c6d1 100644 --- a/src/V3File.h +++ b/src/V3File.h @@ -285,7 +285,7 @@ public: explicit V3OutVFile(const string& filename) : V3OutCFile{filename, V3OutFormatter::LA_VERILOG} {} ~V3OutVFile() override = default; - virtual void putsHeader() { puts("// Verilated -*- Verilog -*-\n"); } + void putsHeader() override { puts("// Verilated -*- Verilog -*-\n"); } }; class V3OutXmlFile final : public V3OutFile {