]> granicus.if.org Git - clang/commit
Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 3 May 2012 18:27:39 +0000 (18:27 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 3 May 2012 18:27:39 +0000 (18:27 +0000)
commite0d3b4cd2b66f1cef26cacbed5820ab7c22ad5b3
tree88f65547224c48c0d2958ebc4a488b864989bc42
parentdd160f3ed50def10765ed823bf4ce2a56b2cd035
Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between
cases in switch statements. Also add a [[clang::fallthrough]] attribute, which
can be used to suppress the warning in the case of intentional fallthrough.

Patch by Alexander Kornienko!

The handling of C++11 attribute namespaces in this patch is temporary, and will
be replaced with a cleaner mechanism in a subsequent patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156086 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
docs/LanguageExtensions.html
include/clang/Basic/Attr.td
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/AttributeList.h
lib/Analysis/CFG.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Sema/AnalysisBasedWarnings.cpp
lib/Sema/AttributeList.cpp
lib/Sema/SemaStmtAttr.cpp
test/SemaCXX/switch-implicit-fallthrough-cxx98.cpp [new file with mode: 0644]
test/SemaCXX/switch-implicit-fallthrough.cpp [new file with mode: 0644]