[llvm] r231218 - Make OptionValue explicitly copyable

David Blaikie dblaikie at gmail.com
Tue Mar 3 23:09:53 PST 2015


Author: dblaikie
Date: Wed Mar  4 01:09:53 2015
New Revision: 231218

URL: http://llvm.org/viewvc/llvm-project?rev=231218&view=rev
Log:
Make OptionValue explicitly copyable

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.

Modified:
    llvm/trunk/include/llvm/Support/CommandLine.h

Modified: llvm/trunk/include/llvm/Support/CommandLine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=231218&r1=231217&r2=231218&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CommandLine.h (original)
+++ llvm/trunk/include/llvm/Support/CommandLine.h Wed Mar  4 01:09:53 2015
@@ -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 OptionVa
 
 protected:
   ~OptionValueCopy() = default;
+  OptionValueCopy(const OptionValueCopy&) = default;
+  OptionValueCopy &operator=(const OptionValueCopy&) = default;
 
 public:
   OptionValueCopy() : Valid(false) {}
@@ -428,6 +433,9 @@ struct OptionValueBase<DataType, false>
 
 protected:
   ~OptionValueBase() = default;
+  OptionValueBase() = default;
+  OptionValueBase(const OptionValueBase&) = default;
+  OptionValueBase &operator=(const OptionValueBase&) = default;
 };
 
 // Top-level option class.





More information about the llvm-commits mailing list