[clang] 94938d7 - [Syntax] Prevent (accidentally) copying TokenBuffer
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 27 16:09:25 PDT 2020
Author: Sam McCall
Date: 2020-03-28T00:09:09+01:00
New Revision: 94938d7d41cd11c4539ff93b801fe53cb4fddba2
URL: https://github.com/llvm/llvm-project/commit/94938d7d41cd11c4539ff93b801fe53cb4fddba2
DIFF: https://github.com/llvm/llvm-project/commit/94938d7d41cd11c4539ff93b801fe53cb4fddba2.diff
LOG: [Syntax] Prevent (accidentally) copying TokenBuffer
Added:
Modified:
clang/include/clang/Tooling/Syntax/Tokens.h
Removed:
################################################################################
diff --git a/clang/include/clang/Tooling/Syntax/Tokens.h b/clang/include/clang/Tooling/Syntax/Tokens.h
index 2ee840074810..e9918eac7845 100644
--- a/clang/include/clang/Tooling/Syntax/Tokens.h
+++ b/clang/include/clang/Tooling/Syntax/Tokens.h
@@ -176,6 +176,12 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Token &T);
class TokenBuffer {
public:
TokenBuffer(const SourceManager &SourceMgr) : SourceMgr(&SourceMgr) {}
+
+ TokenBuffer(TokenBuffer &&) = default;
+ TokenBuffer(const TokenBuffer &) = delete;
+ TokenBuffer &operator=(TokenBuffer &&) = default;
+ TokenBuffer &operator=(const TokenBuffer &) = delete;
+
/// All tokens produced by the preprocessor after all macro replacements,
/// directives, etc. Source locations found in the clang AST will always
/// point to one of these tokens.
More information about the cfe-commits
mailing list