[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann sbergman at redhat.com
Wed Oct 4 09:59:05 UTC 2017


 compilerplugins/clang/blockblock.cxx      |    7 +++++++
 compilerplugins/clang/test/blockblock.cxx |    2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit f4514f356a08a4108c5cdfb1d12855df297097a4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 4 11:58:30 2017 +0200

    Fix test, and add missing TraverseFunctionDecl base case
    
    Change-Id: I31f238fe931e8d890cd70b1a1eb52f042f487a76

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
         {


More information about the Libreoffice-commits mailing list