[clang] [LifetimeSafety] Warn when lifetimebound attribute is present on the definition but not on declaration (PR #197753)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Mon May 18 06:24:40 PDT 2026
================
@@ -415,6 +416,28 @@ class LifetimeChecker {
}
}
+ void reportMisplacedLifetimebound() {
+ const FunctionDecl *FDef = dyn_cast<FunctionDecl>(FD);
+ if (!FDef)
+ return;
+
+ const FunctionDecl *FDecl = FDef->getPreviousDecl();
----------------
Xazax-hun wrote:
Sounds good to me.
https://github.com/llvm/llvm-project/pull/197753
More information about the cfe-commits
mailing list