Bug 1339652 - Delete UnionMember's copy constructor, because it can't safely be used in the C++ object model. r=bz

--HG--
extra : rebase_source : fff9dc6738c4929f8e6f32c866f68778875ddab8
This commit is contained in:
Jeff Walden 2017-02-14 11:23:40 -08:00
parent 8f8272ae04
commit a80694a3cb

View File

@ -21,7 +21,14 @@ class UnionMember
{
AlignedStorage2<T> mStorage;
// Copy construction can't be supported because C++ requires that any enclosed
// T be initialized in a way C++ knows about -- that is, by |new| or similar.
UnionMember(const UnionMember&) = delete;
public:
UnionMember() = default;
~UnionMember() = default;
T& SetValue()
{
new (mStorage.addr()) T();