compilerplugins/clang/makeshared.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 1446e097e76669c0d7749ec0f8918606d3cc4c28 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Jan 27 21:07:10 2020 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Jan 27 23:13:57 2020 +0100 Fix loplugin:makeshared for libc++ ...where the std::make_shared ctor has a default argument, > template<class _Yp> > explicit shared_ptr(_Yp* __p, > typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat()); Change-Id: Ia97d16f64a7e9b4f48112b033dcdb6722d4da791 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87552 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/compilerplugins/clang/makeshared.cxx b/compilerplugins/clang/makeshared.cxx index b1f1c13ce640..398a3acc4654 100644 --- a/compilerplugins/clang/makeshared.cxx +++ b/compilerplugins/clang/makeshared.cxx @@ -68,7 +68,8 @@ bool MakeShared::VisitCXXConstructExpr(CXXConstructExpr const* constructExpr) return true; if (!loplugin::TypeCheck(constructExpr->getType()).ClassOrStruct("shared_ptr").StdNamespace()) return true; - if (constructExpr->getNumArgs() != 1) + if (!(constructExpr->getNumArgs() == 1 + || (constructExpr->getNumArgs() > 1 && isa<CXXDefaultArgExpr>(constructExpr->getArg(1))))) return true; auto cxxNewExpr = dyn_cast<CXXNewExpr>(constructExpr->getArg(0)->IgnoreParenImpCasts()); if (!cxxNewExpr) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits