summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilerplugins/clang/blockblock.cxx7
-rw-r--r--compilerplugins/clang/test/blockblock.cxx2
2 files changed, 8 insertions, 1 deletions
diff --git a/compilerplugins/clang/blockblock.cxx b/compilerplugins/clang/blockblock.cxx
index 3d5d69c2ab57..a4ac7ffb8edb 100644
--- a/compilerplugins/clang/blockblock.cxx
+++ b/compilerplugins/clang/blockblock.cxx
@@ -35,6 +35,13 @@ public:
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
+ bool TraverseFunctionDecl(FunctionDecl * decl) {
+ if (containsPreprocessingConditionalInclusion(decl->getSourceRange())) {
+ return true;
+ }
+ return RecursiveASTVisitor::TraverseFunctionDecl(decl);
+ }
+
bool TraverseCXXMethodDecl(CXXMethodDecl * decl) {
if (containsPreprocessingConditionalInclusion(decl->getSourceRange())) {
return true;
diff --git a/compilerplugins/clang/test/blockblock.cxx b/compilerplugins/clang/test/blockblock.cxx
index 89733103eb58..2463ccaa7fd5 100644
--- a/compilerplugins/clang/test/blockblock.cxx
+++ b/compilerplugins/clang/test/blockblock.cxx
@@ -9,7 +9,7 @@
int f(bool b1, bool b2) {
if (b1 || b2) {
-#if 1
+#if 0
if (b1)
#endif
{