[clang] [LifetimeSafety] Warn on incorrectly placed `[[clang::lifetimebound]]` attributes (PR #196144)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Fri May 8 07:12:33 PDT 2026
================
@@ -624,12 +624,19 @@ Warning to detect invalidation of references.
}];
}
+def LifetimeSafetyLifetimeboundViolation : DiagGroup<"lifetime-safety-lifetimebound-violation"> {
+ code Documentation = [{
+Warning to detect lifetimebound violations introduced by marking parameter as lifetimebound but not returning it in any way.
----------------
Xazax-hun wrote:
I wonder if we need a different wording here. It is very much possible that the code actually does return something that was lifetimebound to this parameter but we cannot track it due to missing annotations or the analysis not covering some constructs.
https://github.com/llvm/llvm-project/pull/196144
More information about the cfe-commits
mailing list