summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-11-28 09:47:22 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-11-28 14:09:25 +0100
commit9f4491477b4bc221527633467c17c2529f1f0714 (patch)
treeab3279f7b6007e18c866244dab849e6d0199a57b
parent6db709ba79fec6f75dd7385ce57c65a62fc2254e (diff)
Add back UnusedMethods::TraverseCXXDeductionGuideDecl, properly ifdef'ed
...as is already done in 65d6c642590bd5f51c04228d941608322a85f1ac "loplugin:casttovoid". (This reverts 5eec6db4addd7cc665222e1a4d05c35b13719847 "fix loplugin unusedmethods".) Change-Id: Ibe6a7d9ce58aa70707538854ac64ad07022ea7b6 Reviewed-on: https://gerrit.libreoffice.org/45388 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--compilerplugins/clang/unusedmethods.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx
index 1a707de5893a..549bb2bb6766 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -118,6 +118,9 @@ public:
bool TraverseFunctionDecl( FunctionDecl* );
bool TraverseCXXMethodDecl( CXXMethodDecl* );
bool TraverseCXXConversionDecl( CXXConversionDecl* );
+#if CLANG_VERSION >= 50000
+ bool TraverseCXXDeductionGuideDecl( CXXDeductionGuideDecl* );
+#endif
private:
void logCallToRootMethods(const FunctionDecl* functionDecl, std::set<MyFuncInfo>& funcSet);
MyFuncInfo niceName(const FunctionDecl* functionDecl);
@@ -387,6 +390,16 @@ bool UnusedMethods::TraverseCXXConversionDecl(CXXConversionDecl* f)
currentFunctionDecl = copy;
return ret;
}
+#if CLANG_VERSION >= 50000
+bool UnusedMethods::TraverseCXXDeductionGuideDecl(CXXDeductionGuideDecl* f)
+{
+ auto copy = currentFunctionDecl;
+ currentFunctionDecl = f;
+ bool ret = RecursiveASTVisitor::TraverseCXXDeductionGuideDecl(f);
+ currentFunctionDecl = copy;
+ return ret;
+}
+#endif
loplugin::Plugin::Registration< UnusedMethods > X("unusedmethods", false);