aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-09-04 20:30:37 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-09-04 20:30:37 +0000
commita6e8b685e13492abfb2e58dc49007deda165a00d (patch)
tree279bbf503976a5c882db2f0699a858d10e66a5e9 /clang/lib/Parse/ParseTentative.cpp
parenteca01b031d44da54239d9956ba0acc7cf2f7798b (diff)
downloadllvm-a6e8b685e13492abfb2e58dc49007deda165a00d.zip
llvm-a6e8b685e13492abfb2e58dc49007deda165a00d.tar.gz
llvm-a6e8b685e13492abfb2e58dc49007deda165a00d.tar.bz2
[c++20] P1143R2: Add support for the C++20 'constinit' keyword.
This is mostly the same as the [[clang::require_constant_initialization]] attribute, but has a couple of additional syntactic and semantic restrictions. In passing, I added a warning for the attribute form being added after we have already seen the initialization of the variable (but before we see the definition); that case previously slipped between the cracks and the attribute was silently ignored. llvm-svn: 370972
Diffstat (limited to 'clang/lib/Parse/ParseTentative.cpp')
-rw-r--r--clang/lib/Parse/ParseTentative.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index 8e56e0c..2eee15b 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -1408,6 +1408,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
case tok::kw_typedef:
case tok::kw_constexpr:
case tok::kw_consteval:
+ case tok::kw_constinit:
// storage-class-specifier
case tok::kw_register:
case tok::kw_static: