summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/singlevalfields.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-01-27 15:00:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-01-27 22:00:26 +0100
commit06111a2661ece65fbc2e8306acb1e26f0e3cdcde (patch)
tree956263ae1cfcbf3c467475ee40ddd9afa64a2a62 /compilerplugins/clang/singlevalfields.cxx
parenttdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor (diff)
downloadcore-06111a2661ece65fbc2e8306acb1e26f0e3cdcde.tar.gz
core-06111a2661ece65fbc2e8306acb1e26f0e3cdcde.zip
Adapt to Clang 11 move of DynTypedNodeList
...in <https://github.com/llvm/llvm-project/commit/ 8a81daaa8b58aeaa192a47c4ce7f94b4d59ce082> "[AST] Split parent map traversal logic into ParentMapContext.h", causing failures like > compilerplugins/clang/constmethod.cxx: In member function ‘bool {anonymous}::ConstMethod::checkIfCanBeConst(const clang::Stmt*, const clang::CXXMethodDecl*)’: > compilerplugins/clang/constmethod.cxx:191:70: error: invalid use of incomplete type ‘class clang::DynTypedNodeList’ > 191 | auto parentsRange = compiler.getASTContext().getParents(*stmt); > | ^ > In file included from compilerplugins/clang/plugin.hxx:15, > from compilerplugins/clang/constmethod.cxx:16: > include/clang/AST/ASTContext.h:97:7: note: forward declaration of ‘class clang::DynTypedNodeList’ > 97 | class DynTypedNodeList; > | ^~~~~~~~~~~~~~~~ Change-Id: Ib82d04608fa306a715af481422017c24053a01c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87533 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/singlevalfields.cxx')
-rw-r--r--compilerplugins/clang/singlevalfields.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/compilerplugins/clang/singlevalfields.cxx b/compilerplugins/clang/singlevalfields.cxx
index 2949ce10ef3c..2efb562473ae 100644
--- a/compilerplugins/clang/singlevalfields.cxx
+++ b/compilerplugins/clang/singlevalfields.cxx
@@ -12,8 +12,15 @@
#include <iostream>
#include <fstream>
#include <set>
+
+#include "config_clang.h"
+
#include "plugin.hxx"
+#if CLANG_VERSION >= 110000
+#include "clang/AST/ParentMapContext.h"
+#endif
+
/**
Look for fields that are only ever assigned a single constant value.