[clang] [clang] Improve the lifetime_capture_by diagnostic on the constructor. (PR #117792)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 27 19:57:41 PST 2024
================
@@ -535,6 +535,9 @@ static void visitFunctionCallArguments(IndirectLocalPath &Path, Expr *Call,
bool EnableGSLAnalysis = !Callee->getASTContext().getDiagnostics().isIgnored(
diag::warn_dangling_lifetime_pointer, SourceLocation());
+ bool EnableDanglingCapture =
+ !Callee->getASTContext().getDiagnostics().isIgnored(
+ diag::warn_dangling_reference_captured, SourceLocation());
----------------
usx95 wrote:
I would not disable this based on new warning because:
1. This is not the warning that is triggered in this path.
2. We are considering both annotations as aliases in case of constructors. It would be better to do this unconditionally.
https://github.com/llvm/llvm-project/pull/117792
More information about the cfe-commits
mailing list