[c++20] P1143R2: Add support for the C++20 'constinit' keyword.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 4 Sep 2019 20:30:37 +0000 (20:30 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 4 Sep 2019 20:30:37 +0000 (20:30 +0000)
commita6e8b685e13492abfb2e58dc49007deda165a00d
tree279bbf503976a5c882db2f0699a858d10e66a5e9
parenteca01b031d44da54239d9956ba0acc7cf2f7798b
[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
27 files changed:
clang/include/clang/AST/Decl.h
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/DiagnosticCommonKinds.td
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Basic/Specifiers.h
clang/include/clang/Basic/TokenKinds.def
clang/lib/AST/Decl.cpp
clang/lib/Frontend/InitPreprocessor.cpp
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Parse/ParseTentative.cpp
clang/lib/Sema/DeclSpec.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaType.cpp
clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p1.cpp [new file with mode: 0644]
clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p2.cpp [new file with mode: 0644]
clang/test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p3.cpp [new file with mode: 0644]
clang/test/FixIt/fixit-c++2a.cpp
clang/test/Lexer/cxx-features.cpp
clang/test/Lexer/cxx2a_keyword_as_cxx17.cpp
clang/test/Misc/pragma-attribute-cxx.cpp
clang/test/Misc/pragma-attribute-supported-attributes-list.test
clang/test/Parser/cxx0x-decl.cpp
clang/test/SemaCXX/attr-require-constant-initialization.cpp
clang/www/cxx_status.html