From c17c81254e2bcae90273884979d2a296c743c0f6 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 25 Oct 2017 20:00:38 -0400 Subject: [PATCH] Internals: Use = delete via a macro for a bit of C++11 forward compatibility --- include/verilated.h | 4 ++-- include/verilated_save.h | 4 ++-- include/verilated_vcd_c.h | 2 +- include/verilatedos.h | 2 ++ src/V3CCtors.cpp | 2 +- src/V3File.h | 2 +- src/V3Options.h | 2 +- src/V3Parse.h | 2 +- src/V3SymTable.h | 2 +- 9 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/verilated.h b/include/verilated.h index 445a872b8..c08a4b63e 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -102,8 +102,8 @@ enum VerilatedVarFlags { class VerilatedModule { private: const char* m_namep; ///< Module name - VerilatedModule(); ///< N/A, always use named constructor below - VerilatedModule(const VerilatedModule& ); ///< N/A, no copy constructor + VerilatedModule() VL_EQ_DELETE; ///< N/A, always use named constructor below + VerilatedModule(const VerilatedModule& ) VL_EQ_DELETE; ///< N/A, no copy constructor public: explicit VerilatedModule(const char* namep); ///< Create module with given hierarchy name ~VerilatedModule(); diff --git a/include/verilated_save.h b/include/verilated_save.h index e774d2679..f90f54a1c 100644 --- a/include/verilated_save.h +++ b/include/verilated_save.h @@ -71,7 +71,7 @@ public: return *this; // For function chaining } private: - VerilatedSerialize(const VerilatedSerialize& ); ///< N/A, no copy constructor + VerilatedSerialize(const VerilatedSerialize&) VL_EQ_DELETE; ///< N/A, no copy constructor VerilatedSerialize& bufferCheck() { // Flush the write buffer if there's not enough space left for new information // We only call this once per vector, so we need enough slop for a very wide "b###" line @@ -134,7 +134,7 @@ public: VerilatedDeserialize& readAssert (const void* __restrict datap, size_t size); VerilatedDeserialize& readAssert (vluint64_t data) { return readAssert(&data, sizeof(data)); } private: - VerilatedDeserialize(const VerilatedDeserialize& ); ///< N/A, no copy constructor + VerilatedDeserialize(const VerilatedDeserialize&) VL_EQ_DELETE; ///< N/A, no copy constructor VerilatedDeserialize& bufferCheck() { // Flush the write buffer if there's not enough space left for new information // We only call this once per vector, so we need enough slop for a very wide "b###" line diff --git a/include/verilated_vcd_c.h b/include/verilated_vcd_c.h index 23726c12e..29ee19ba1 100644 --- a/include/verilated_vcd_c.h +++ b/include/verilated_vcd_c.h @@ -143,7 +143,7 @@ private: return out + static_cast((code)%94+33); } - VerilatedVcd(const VerilatedVcd& ); ///< N/A, no copy constructor + VerilatedVcd(const VerilatedVcd&) VL_EQ_DELETE; ///< N/A, no copy constructor protected: // METHODS diff --git a/include/verilatedos.h b/include/verilatedos.h index a1e479ae5..5102e3821 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -109,6 +109,7 @@ // C++-2011 #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define VL_EQ_DELETE = delete # define VL_HAS_UNIQUE_PTR # define VL_HAS_UNORDERED_MAP # define VL_HAS_UNORDERED_SET @@ -118,6 +119,7 @@ # define VL_INCLUDE_UNORDERED_MAP # define VL_INCLUDE_UNORDERED_SET #else +# define VL_EQ_DELETE # define vl_unique_ptr std::auto_ptr # define vl_unordered_map std::map # define vl_unordered_set std::set diff --git a/src/V3CCtors.cpp b/src/V3CCtors.cpp index 524431a75..747382100 100644 --- a/src/V3CCtors.cpp +++ b/src/V3CCtors.cpp @@ -96,7 +96,7 @@ public: } ~V3CCtorsVisitor() {} private: - explicit V3CCtorsVisitor(const V3CCtorsVisitor&); ///< N/A, no copy constructor + explicit V3CCtorsVisitor(const V3CCtorsVisitor&) VL_EQ_DELETE; ///< N/A, no copy constructor }; //###################################################################### diff --git a/src/V3File.h b/src/V3File.h index f815b44e7..22f482958 100644 --- a/src/V3File.h +++ b/src/V3File.h @@ -77,7 +77,7 @@ class V3InFilterImp; class V3InFilter { V3InFilterImp* m_impp; - V3InFilter(const V3InFilter&); ///< N/A, no copy constructor + V3InFilter(const V3InFilter&) VL_EQ_DELETE; ///< N/A, no copy constructor public: // TYPES typedef list StrList; diff --git a/src/V3Options.h b/src/V3Options.h index acd8e964d..6d0662225 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -180,7 +180,7 @@ class V3Options { bool parseLangExt(const char* swp, const char* langswp, const V3LangCode& lc); string filePathCheckOneDir(const string& modname, const string& dirname); - V3Options(const V3Options&); ///< N/A, no copy constructor + V3Options(const V3Options&) VL_EQ_DELETE; ///< N/A, no copy constructor public: // CREATORS diff --git a/src/V3Parse.h b/src/V3Parse.h index dfdd38017..fcab13b88 100644 --- a/src/V3Parse.h +++ b/src/V3Parse.h @@ -36,7 +36,7 @@ class V3Parse { private: V3ParseImp* m_impp; - V3Parse(const V3Parse&); ///< N/A, no copy constructor + V3Parse(const V3Parse&) VL_EQ_DELETE; ///< N/A, no copy constructor public: // CONSTRUCTORS // We must allow reading multiple files into one parser diff --git a/src/V3SymTable.h b/src/V3SymTable.h index 85a3e57ea..c7c06658c 100644 --- a/src/V3SymTable.h +++ b/src/V3SymTable.h @@ -250,7 +250,7 @@ private: VSymEnt* m_symRootp; // Root symbol table SymStack m_symsp; // All symbol tables, to cleanup - VSymGraph(const VSymGraph&); ///< N/A, no copy constructor + VSymGraph(const VSymGraph&) VL_EQ_DELETE; ///< N/A, no copy constructor protected: friend class VSymEnt;