================
@@ -1284,16 +1294,26 @@ void checkExprLifetime(Sema &SemaRef, const 
InitializedEntity &Entity,
   auto LTResult = getEntityLifetime(&Entity);
   LifetimeKind LK = LTResult.getInt();
   const InitializedEntity *ExtendingEntity = LTResult.getPointer();
-  checkExprLifetimeImpl(SemaRef, &Entity, ExtendingEntity, LK, nullptr, Init);
+  bool EnableLifetimeWarnings = !SemaRef.getDiagnostics().isIgnored(
+      diag::warn_dangling_lifetime_pointer, SourceLocation());
+  checkExprLifetimeImpl(SemaRef, &Entity, ExtendingEntity, LK, nullptr, Init,
----------------
shafik wrote:

```suggestion
  checkExprLifetimeImpl(SemaRef, &Entity, ExtendingEntity, LK, 
/*AEntity=*/nullptr, Init,
```

nitpick

https://github.com/llvm/llvm-project/pull/99032
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to