P0188R1: add support for standard [[fallthrough]] attribute. This is almost
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 8 Mar 2016 00:32:55 +0000 (00:32 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 8 Mar 2016 00:32:55 +0000 (00:32 +0000)
commit4f902c7eccd47cc3e1d0ceebca3025406a2e5fa7
treef4f111a17e5cb2aa89e7050bd5c8ef41e30bc2f2
parent12350a8e133caefd43d1bc1d18baa66ba5202a3d
P0188R1: add support for standard [[fallthrough]] attribute. This is almost
exactly the same as clang's existing [[clang::fallthrough]] attribute, which
has been updated to have the same semantics. The one significant difference
is that [[fallthrough]] is ill-formed if it's not used immediately before a
switch label (even when -Wimplicit-fallthrough is disabled). To support that,
we now build a CFG of any function that uses a '[[fallthrough]];' statement
to check.

In passing, fix some bugs with our support for statement attributes -- in
particular, diagnose their use on declarations, rather than asserting.

llvm-svn: 262881
22 files changed:
clang/include/clang/AST/Attr.h
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/AttributeList.h
clang/include/clang/Sema/ScopeInfo.h
clang/lib/Sema/AnalysisBasedWarnings.cpp
clang/lib/Sema/AttributeList.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaStmtAttr.cpp
clang/test/Analysis/cxx11-crashes.cpp
clang/test/PCH/Inputs/cxx11-statement-attributes.h
clang/test/PCH/cxx11-statement-attributes.cpp
clang/test/Parser/cxx0x-attributes.cpp
clang/test/SemaCXX/for-range-examples.cpp
clang/test/SemaCXX/generalized-deprecated.cpp
clang/test/SemaCXX/nodiscard.cpp
clang/test/SemaCXX/switch-implicit-fallthrough-macro.cpp
clang/test/SemaCXX/switch-implicit-fallthrough-per-method.cpp
clang/test/SemaCXX/switch-implicit-fallthrough.cpp
clang/utils/TableGen/ClangAttrEmitter.cpp
clang/www/cxx_status.html