Fix compilerplugins/clang/test/useuniqueptr.cxx for clang-cl

...where it failed with

> error: 'error' diagnostics expected but not seen:
>   File C:/lo-clang/core/compilerplugins/clang/test/useuniqueptr.cxx Line 266: rather manage this var with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr]
>   File C:/lo-clang/core/compilerplugins/clang/test/useuniqueptr.cxx Line 275: rather manage this member with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr]

apparently due to differences in how some std types are implemented.

Change-Id: Ib81ed1a1da867359e7f22bb6fb6ceb3e610e2b41
Reviewed-on: https://gerrit.libreoffice.org/67226
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2019-01-31 16:26:20 +01:00
parent dbc92eab4d
commit 4d3571a309

View File

@@ -676,7 +676,7 @@ void UseUniquePtr::CheckLoopDelete(const FunctionDecl* functionDecl, const CXXDe
init = compat::IgnoreImplicit(x->getArg(0));
}
if (auto x = dyn_cast<CXXMemberCallExpr>(init))
init = x->getImplicitObjectArgument();
init = x->getImplicitObjectArgument()->IgnoreParenImpCasts();
if ((memberExpr = dyn_cast<MemberExpr>(init)))
break;
// look for deletes of an iterator object where the iterator is over a var