Moved operator delete to public area to appease gcc and conform to C++ standard.

llvm-svn: 207027
This commit is contained in:
Abramo Bagnara 2014-04-23 21:28:18 +00:00
parent d75fb28ae7
commit b8dcece68f
1 changed files with 7 additions and 2 deletions

View File

@ -104,6 +104,12 @@ public:
return ::operator new(S, R);
}
// SExpr objects cannot be deleted.
// This declaration is public to avoid breaking gcc compilation
// with REQUIRES_EH=1.
// The access check is also mandated by C++11 5.3.4p17 and former standards.
void operator delete(void *) LLVM_DELETED_FUNCTION;
protected:
SExpr(TIL_Opcode Op) : Opcode(Op), Reserved(0), Flags(0) {}
SExpr(const SExpr &E) : Opcode(E.Opcode), Reserved(0), Flags(E.Flags) {}
@ -115,9 +121,8 @@ protected:
private:
SExpr() LLVM_DELETED_FUNCTION;
// SExpr objects must be created in an arena and cannot be deleted.
// SExpr objects must be created in an arena.
void *operator new(size_t) LLVM_DELETED_FUNCTION;
void operator delete(void *) LLVM_DELETED_FUNCTION;
};