diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-01-27 15:00:41 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-01-27 22:00:26 +0100 |
commit | 06111a2661ece65fbc2e8306acb1e26f0e3cdcde (patch) | |
tree | 956263ae1cfcbf3c467475ee40ddd9afa64a2a62 /compilerplugins/clang/constvars.cxx | |
parent | 4b723bf58ce49faef032099062515a50d6afcece (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/constvars.cxx')
-rw-r--r-- | compilerplugins/clang/constvars.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compilerplugins/clang/constvars.cxx b/compilerplugins/clang/constvars.cxx index d4a431dc14f0..f89301fed205 100644 --- a/compilerplugins/clang/constvars.cxx +++ b/compilerplugins/clang/constvars.cxx @@ -18,10 +18,17 @@ #include <algorithm> #include <sys/file.h> #include <unistd.h> + +#include "config_clang.h" + #include "plugin.hxx" #include "compat.hxx" #include "check.hxx" +#if CLANG_VERSION >= 110000 +#include "clang/AST/ParentMapContext.h" +#endif + /** Look for static vars that are only assigned to once, and never written to, they can be const. */ |