]> granicus.if.org Git - clang/commit
[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)
commit940249d8175d8db209f3e6e4557aaa6f1d99c00f
tree756c9f3cd9ff717961b6dc1a504894be82e6373d
parent3c6ee3dacaccb1f818db5d8b9a6169d2d116e7aa
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370972 91177308-0d34-0410-b5e6-96231b3b80d8
27 files changed:
include/clang/AST/Decl.h
include/clang/Basic/Attr.td
include/clang/Basic/DiagnosticCommonKinds.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/Specifiers.h
include/clang/Basic/TokenKinds.def
lib/AST/Decl.cpp
lib/Frontend/InitPreprocessor.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Parse/ParseTentative.cpp
lib/Sema/DeclSpec.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaType.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p1.cpp [new file with mode: 0644]
test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p2.cpp [new file with mode: 0644]
test/CXX/dcl.dcl/dcl.spec/dcl.constinit/p3.cpp [new file with mode: 0644]
test/FixIt/fixit-c++2a.cpp
test/Lexer/cxx-features.cpp
test/Lexer/cxx2a_keyword_as_cxx17.cpp
test/Misc/pragma-attribute-cxx.cpp
test/Misc/pragma-attribute-supported-attributes-list.test
test/Parser/cxx0x-decl.cpp
test/SemaCXX/attr-require-constant-initialization.cpp
www/cxx_status.html