[clang] [Clang] Diagnose dangling references in std::vector. (PR #111753)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 12:53:37 PDT 2024


================
@@ -404,7 +404,7 @@ shouldTrackFirstArgumentForConstructor(const CXXConstructExpr *Ctor) {
   if (LHSRecordDecl->hasAttr<PointerAttr>())
     return true;
 
-  if (Ctor->getConstructor()->getNumParams() != 1 ||
+  if (Ctor->getConstructor()->getNumParams() < 1 ||
----------------
usx95 wrote:

Looks like we are checking for empty params. Let's replace this with `Ctor->getConstructor()-> param_empty()`.

https://github.com/llvm/llvm-project/pull/111753


More information about the cfe-commits mailing list