diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2017-10-18 14:33:27 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2017-10-18 14:33:27 +0000 |
commit | 644b1eb1f21899b4fd64824391fa597f0ca9dff0 (patch) | |
tree | 27298c2148bbf58ab607cdcd11059da652144d3f /lib/Sema | |
parent | 1b97bbcc56f87338a7607a101ed153118bf7477d (diff) | |
download | clang-644b1eb1f21899b4fd64824391fa597f0ca9dff0.tar.gz |
Enable support for the [[fallthrough]] attribute from WG14 N2052 when enabling double square bracket attributes in C code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316083 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/AnalysisBasedWarnings.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 7a31711e72..f004a990a4 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -1291,16 +1291,15 @@ static StringRef getFallthroughAttrSpelling(Preprocessor &PP, static void DiagnoseSwitchLabelsFallthrough(Sema &S, AnalysisDeclContext &AC, bool PerFunction) { - // Only perform this analysis when using C++11. There is no good workflow - // for this warning when not using C++11. There is no good way to silence - // the warning (no attribute is available) unless we are using C++11's support - // for generalized attributes. Once could use pragmas to silence the warning, - // but as a general solution that is gross and not in the spirit of this - // warning. + // Only perform this analysis when using [[]] attributes. There is no good + // workflow for this warning when not using C++11. There is no good way to + // silence the warning (no attribute is available) unless we are using + // [[]] attributes. One could use pragmas to silence the warning, but as a + // general solution that is gross and not in the spirit of this warning. // - // NOTE: This an intermediate solution. There are on-going discussions on + // NOTE: This an intermediate solution. There are on-going discussions on // how to properly support this warning outside of C++11 with an annotation. - if (!AC.getASTContext().getLangOpts().CPlusPlus11) + if (!AC.getASTContext().getLangOpts().DoubleSquareBracketAttributes) return; FallthroughMapper FM(S); |