Make OptionValue explicitly copyable
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 4 Mar 2015 07:09:53 +0000 (07:09 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 4 Mar 2015 07:09:53 +0000 (07:09 +0000)
Since OptionValue (& its base classes) have user-declared dtors, use of
the implicit copy ctor/assignment operator is deprecated in C++11.
Provide them explicitly (defaulted) to avoid depending on this
deprecated feature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231218 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/CommandLine.h

index df6f99d6d809c491cdc9d733b4a6a5fce0bc35ea..629fa46fac8e44948e2a042697941a78df0c790e 100644 (file)
@@ -356,6 +356,9 @@ struct GenericOptionValue {
 
 protected:
   ~GenericOptionValue() = default;
+  GenericOptionValue() = default;
+  GenericOptionValue(const GenericOptionValue&) = default;
+  GenericOptionValue &operator=(const GenericOptionValue &) = default;
 
 private:
   virtual void anchor();
@@ -394,6 +397,8 @@ template <class DataType> class OptionValueCopy : public GenericOptionValue {
 
 protected:
   ~OptionValueCopy() = default;
+  OptionValueCopy(const OptionValueCopy&) = default;
+  OptionValueCopy &operator=(const OptionValueCopy&) = default;
 
 public:
   OptionValueCopy() : Valid(false) {}
@@ -428,6 +433,9 @@ struct OptionValueBase<DataType, false> : OptionValueCopy<DataType> {
 
 protected:
   ~OptionValueBase() = default;
+  OptionValueBase() = default;
+  OptionValueBase(const OptionValueBase&) = default;
+  OptionValueBase &operator=(const OptionValueBase&) = default;
 };
 
 // Top-level option class.