summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/nullptr.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-08-16 16:25:48 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-08-16 19:54:25 +0200
commite380e353485c3479abe645d3b6da9e007057a079 (patch)
tree8edd4844f4bf4a7a5fded924ee1081605f1d06b5 /compilerplugins/clang/nullptr.cxx
parent91e213f58f264f110c6a94c1c18c00333e6fcdf6 (diff)
Adapt loplugin:nullptr to RecursiveASTVisitior::TraverseInitListExpr change
...<https://github.com/llvm/llvm-project/commit/ 0a42fe70a566f22599e04a6f1344ca2dc5565e17> "[AST] Treat semantic form of InitListExpr as implicit code in traversals" Change-Id: Ifd17009fcc6933abf0e9178dbe47fb9c14b274b7 Reviewed-on: https://gerrit.libreoffice.org/77595 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/nullptr.cxx')
-rw-r--r--compilerplugins/clang/nullptr.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/compilerplugins/clang/nullptr.cxx b/compilerplugins/clang/nullptr.cxx
index bcdf606c13e3..30458d7f7f5a 100644
--- a/compilerplugins/clang/nullptr.cxx
+++ b/compilerplugins/clang/nullptr.cxx
@@ -75,6 +75,8 @@ public:
bool TraverseLinkageSpecDecl(LinkageSpecDecl * decl);
+ bool TraverseInitListExpr(InitListExpr * expr, DataRecursionQueue * queue = nullptr);
+
// bool shouldVisitTemplateInstantiations() const { return true; }
private:
@@ -231,6 +233,12 @@ bool Nullptr::TraverseLinkageSpecDecl(LinkageSpecDecl * decl) {
return ret;
}
+bool Nullptr::TraverseInitListExpr(InitListExpr * expr, DataRecursionQueue * queue) {
+ return WalkUpFromInitListExpr(expr)
+ && TraverseSynOrSemInitListExpr(
+ expr->isSemanticForm() ? expr : expr->getSemanticForm(), queue);
+}
+
bool Nullptr::isInLokIncludeFile(SourceLocation spellingLocation) const {
return loplugin::hasPathnamePrefix(
getFileNameOfSpellingLoc(spellingLocation),