diff options
author | Bruno Ricci <riccibrun@gmail.com> | 2019-04-12 13:26:55 +0000 |
---|---|---|
committer | Bruno Ricci <riccibrun@gmail.com> | 2019-04-12 13:26:55 +0000 |
commit | f6c7692d60baad6f5c879c6eab34861567aeecc3 (patch) | |
tree | 94c05b3a7817fcb178c1cbc23fef5168d00bd129 | |
parent | 6460883312aa36d479736082e6decccff8f24b70 (diff) | |
download | bcm5719-llvm-f6c7692d60baad6f5c879c6eab34861567aeecc3.tar.gz bcm5719-llvm-f6c7692d60baad6f5c879c6eab34861567aeecc3.zip |
[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
-rw-r--r-- | clang/include/clang/AST/Stmt.h | 5 | ||||
-rw-r--r-- | clang/include/clang/AST/Type.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index ff6c18c44f0..563a4f92baa 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -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; } diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index cbc05a1a732..12a0213fddf 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -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); } |