summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/unusedvariablemore.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/unusedvariablemore.cxx
parent4b723bf58ce49faef032099062515a50d6afcece (diff)
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/unusedvariablemore.cxx')
-rw-r--r--compilerplugins/clang/unusedvariablemore.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/compilerplugins/clang/unusedvariablemore.cxx b/compilerplugins/clang/unusedvariablemore.cxx
index 8c153164f174..d4b5e40c3e1f 100644
--- a/compilerplugins/clang/unusedvariablemore.cxx
+++ b/compilerplugins/clang/unusedvariablemore.cxx
@@ -9,6 +9,7 @@
*
*/
+#include "config_clang.h"
#include <config_global.h>
#include "plugin.hxx"
#include "compat.hxx"
@@ -16,6 +17,10 @@
#include <unordered_set>
#include <unordered_map>
+#if CLANG_VERSION >= 110000
+#include "clang/AST/ParentMapContext.h"
+#endif
+
namespace loplugin
{
/*