summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-09-05 12:01:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-09-05 14:13:33 +0200
commit265552e8ab1ba86f09146470156ee32db269197b (patch)
tree45f414273f93e54b776c65a51c952a9a361d2fb6
parent2422dfd060fe0a4024b6410e436f2d4c358ece9b (diff)
Use compat::IgnoreImplicit
...for reliable results across Clang versions. Also, there appears to be no need to check for CXXTemporaryObjectExpr both before and after IgnoreImplicit. Change-Id: Ib804591b6d50073c99680d0933e21f32bba29342 Reviewed-on: https://gerrit.libreoffice.org/78640 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--compilerplugins/clang/simplifyconstruct.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/compilerplugins/clang/simplifyconstruct.cxx b/compilerplugins/clang/simplifyconstruct.cxx
index 55f2404f8ab1..bd8aaaf03957 100644
--- a/compilerplugins/clang/simplifyconstruct.cxx
+++ b/compilerplugins/clang/simplifyconstruct.cxx
@@ -88,8 +88,8 @@ bool SimplifyConstruct::VisitVarDecl(VarDecl const* varDecl)
return true;
auto init = varDecl->getInit();
- if (!isa<CXXFunctionalCastExpr>(init->IgnoreImplicit()) && !isa<CXXTemporaryObjectExpr>(init)
- && !isa<CXXTemporaryObjectExpr>(init->IgnoreImplicit()))
+ auto const e1 = compat::IgnoreImplicit(init);
+ if (!isa<CXXFunctionalCastExpr>(e1) && !isa<CXXTemporaryObjectExpr>(e1))
return true;
// e.g. the LANGUAGE_DONTKNOW defines