From 3fb587e89421a862a1e65f47cad17839e2b832e4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 17 Feb 2022 09:42:05 +0100 Subject: Revert "Fix failure of loplugin:useuniqueptr with older compilers" ...0bf61855164af5751e78ca8626c10d604b1ab13b, which should be obsolete now: It speculated why 05a337e297eb0cfe88c99503d760bd9eaf495b7d "loplugin:useuniqueptr look for deleting in loops with iterators" had introduced Foo24 in compilerplugins/clang/test/useuniqueptr.cxx wrapped in #if CLANG_VERSION >= 50000 and came to the conclusion that "either the old compiler lacked Clang's recent "Fix Stmt::ignoreImplicit" (and the above initialization expression happens to include a CXXBindTemporaryExpr, at least with libstdc++), or an even older compiler was used in pre-C++17 mode". But both of those potential reasons should be moot now, as the Clang fix got introduced towards Clang 8, and LO requires C++17 now (except for 3rd-party code). Change-Id: I307afbbecc5f031bca2319c4b22d54bd467eac81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130116 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- compilerplugins/clang/useuniqueptr.cxx | 4 ---- 1 file changed, 4 deletions(-) (limited to 'compilerplugins') diff --git a/compilerplugins/clang/useuniqueptr.cxx b/compilerplugins/clang/useuniqueptr.cxx index ae95cbdfe99e..c0ef34b2823a 100644 --- a/compilerplugins/clang/useuniqueptr.cxx +++ b/compilerplugins/clang/useuniqueptr.cxx @@ -664,10 +664,6 @@ void UseUniquePtr::CheckLoopDelete(const FunctionDecl* functionDecl, const CXXDe if (init) { init = init->IgnoreImplicit(); - if (!compiler.getLangOpts().CPlusPlus17) - if (auto x = dyn_cast(init)) - if (x->isElidable()) - init = x->getArg(0)->IgnoreImplicit(); if (auto x = dyn_cast(init)) if (x->getNumArgs() == 1 || (x->getNumArgs() >= 2 && isa(x->getArg(1)))) -- cgit