[clang] Make [[clang::lifetimebound]] work for expressions coming from default arguments (PR #112047)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 15 08:04:53 PDT 2024


================
@@ -1383,6 +1394,15 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
             << nextPathEntryRange(Path, I + 1, L);
         break;
       }
+
+      case IndirectLocalPathEntry::DefaultArg: {
+        const auto *DAE = cast<CXXDefaultArgExpr>(Elem.E);
+        SemaRef.Diag(DAE->getParam()->getDefaultArgRange().getBegin(),
+                     diag::note_init_with_default_argument)
+            << DAE->getParam() << nextPathEntryRange(Path, I + 1, L);
----------------
higher-performance wrote:

Done.

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


More information about the cfe-commits mailing list