compilerplugins/clang/unnecessaryparen.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 3d885f20269dd4b7485fbe09c70014646e799366 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Nov 12 12:01:53 2018 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Nov 12 14:19:29 2018 +0100 Adapt to new ConstantExpr in Clang trunk towards Clang 8 After <https://reviews.llvm.org/D53921> "Compound literals, enums, et al require const expr" (making use of ConstantExpr recently introduced with <https://reviews.llvm.org/D53475> "Create ConstantExpr class", CompilerTest_compilerplugins_clang started to fail with > [CPT] compilerplugins/clang/test/unnecessaryparen.cxx > error: 'error' diagnostics expected but not seen: > File /data/sbergman/lo-clang2/core/compilerplugins/clang/test/unnecessaryparen.cxx Line 35: parentheses immediately inside case statement [loplugin:unnecessaryparen] > error: 'error' diagnostics seen but not expected: > File /data/sbergman/lo-clang2/core/compilerplugins/clang/test/unnecessaryparen.cxx Line 35: unnecessary parentheses around identifier [loplugin:unnecessaryparen] > 2 errors generated. Change-Id: Iebcfcd9af30e26df02819fbffb105599fa6a1701 Reviewed-on: https://gerrit.libreoffice.org/63285 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/compilerplugins/clang/unnecessaryparen.cxx b/compilerplugins/clang/unnecessaryparen.cxx index 1a26ed21c7fb..b2ad2951ec90 100644 --- a/compilerplugins/clang/unnecessaryparen.cxx +++ b/compilerplugins/clang/unnecessaryparen.cxx @@ -15,6 +15,9 @@ #include <unordered_set> #include <clang/AST/CXXInheritance.h> + +#include "config_clang.h" + #include "compat.hxx" #include "plugin.hxx" @@ -52,6 +55,11 @@ Expr const * ignoreAllImplicit(Expr const * expr) { expr = ce->getImplicitObjectArgument(); } } +#if CLANG_VERSION >= 80000 + else if (auto const e = dyn_cast<ConstantExpr>(expr)) { + expr = e->getSubExpr(); + } +#endif if (expr == oldExpr) return expr; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits