[AST] Forbid copy/move of statements/types

Statements, expressions and types are not supposed to be copied/moved,
and trying to do so is only going to result in tears. Someone tripped
on this a few days ago on the mailing list. NFC.

Differential Revision: https://reviews.llvm.org/D60123

Reviewed By: aaron.ballman

llvm-svn: 358283
This commit is contained in:
Bruno Ricci 2019-04-12 13:26:55 +00:00
parent 6460883312
commit f6c7692d60
2 changed files with 7 additions and 0 deletions

View File

@ -1042,6 +1042,11 @@ public:
return static_cast<StmtClass>(StmtBits.sClass);
}
Stmt(const Stmt &) = delete;
Stmt(Stmt &&) = delete;
Stmt &operator=(const Stmt &) = delete;
Stmt &operator=(Stmt &&) = delete;
const char *getStmtClassName() const;
bool isOMPStructuredBlock() const { return StmtBits.IsOMPStructuredBlock; }

View File

@ -1813,7 +1813,9 @@ public:
friend class ASTWriter;
Type(const Type &) = delete;
Type(Type &&) = delete;
Type &operator=(const Type &) = delete;
Type &operator=(Type &&) = delete;
TypeClass getTypeClass() const { return static_cast<TypeClass>(TypeBits.TC); }