mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 902485. Disallow copy constructors and operator= on WebIDL union structs, because those wouldn't do what you think they should. r=dzbarsky
This commit is contained in:
parent
58ee763141
commit
42d2829264
@ -1623,6 +1623,13 @@ public:
|
||||
void Destroy() {
|
||||
storage.addr()->~T();
|
||||
}
|
||||
|
||||
private:
|
||||
// Disallow the assignment operator, because we have no idea what the right
|
||||
// way to assign T is, and bitwise copying is likely to be wrong. Sadly,
|
||||
// we can't disallow copy-construction here, because we need to have no
|
||||
// constructor, since we're used in a union...
|
||||
void operator=(const UnionMember<T>& aOther) MOZ_DELETE;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
@ -6105,6 +6105,10 @@ ${methods}
|
||||
private:
|
||||
friend class ${structName}Argument;
|
||||
|
||||
// Disallow copy-construction and assignment
|
||||
${structName}(const ${structName}&) MOZ_DELETE;
|
||||
void operator=(const ${structName}&) MOZ_DELETE;
|
||||
|
||||
${destructors}
|
||||
|
||||
enum Type {
|
||||
@ -6228,6 +6232,10 @@ ${methods}
|
||||
JS::MutableHandle<JS::Value> rval) const;
|
||||
|
||||
private:
|
||||
// Disallow copy-construction and assignment
|
||||
${structName}ReturnValue(const ${structName}ReturnValue&) MOZ_DELETE;
|
||||
void operator=(const ${structName}ReturnValue&) MOZ_DELETE;
|
||||
|
||||
enum Type {
|
||||
eUninitialized,
|
||||
${enumValues}
|
||||
|
Loading…
Reference in New Issue
Block a user