[cfe-commits] r167662 - /cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
Ted Kremenek
kremenek at apple.com
Fri Nov 9 20:03:41 PST 2012
Author: kremenek
Date: Fri Nov 9 22:03:41 2012
New Revision: 167662
URL: http://llvm.org/viewvc/llvm-project?rev=167662&view=rev
Log:
Revert "Disable -Wimplicit-fallthrough when not using C++.", pending further discussion on cfe-dev.
Modified:
cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=167662&r1=167661&r2=167662&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Fri Nov 9 22:03:41 2012
@@ -818,19 +818,6 @@
static void DiagnoseSwitchLabelsFallthrough(Sema &S, AnalysisDeclContext &AC,
bool PerFunction) {
- // Only perform this analysis when using C++. There is no good workflow
- // for this warning when using straight C. 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.
- //
- // NOTE: this argument also applies to C++ code not using C++11, as the
- // generalized attributes are not available in earlier C++ dialects.
- // This will require some discussion.
- if (!AC.getASTContext().getLangOpts().CPlusPlus)
- return;
-
FallthroughMapper FM(S);
FM.TraverseStmt(AC.getBody());
More information about the cfe-commits
mailing list