compilerplugins/clang/useuniqueptr.cxx |    4 ----
 1 file changed, 4 deletions(-)

New commits:
commit 3fb587e89421a862a1e65f47cad17839e2b832e4
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Feb 17 09:42:05 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Feb 17 23:16:15 2022 +0100

    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
    <https://reviews.llvm.org/D50666> "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 <sberg...@redhat.com>

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<CXXConstructExpr>(init))
-                                if (x->isElidable())
-                                    init = x->getArg(0)->IgnoreImplicit();
                         if (auto x = dyn_cast<CXXConstructExpr>(init))
                             if (x->getNumArgs() == 1
                                 || (x->getNumArgs() >= 2 && 
isa<CXXDefaultArgExpr>(x->getArg(1))))

Reply via email to