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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231218 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2015-03-04 07:09:53 +00:00
parent 11c03fe898
commit 4e942d63c0

View 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.