[clang] [clang] Fix GNU spellings of lifetimebound/lifetime_capture_by (PR #192070)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 15 06:29:13 PDT 2026
AaronBallman wrote:
> Thanks all for the feedback and the additional questions here.
>
> My original goal for this PR was fairly narrow: to fix the current GNU/standard inconsistency for the member-function postfix spelling.
>
> From the discussion so far, it seems this may be touching a broader modeling question around these attributes. So I am not sure whether this PR should try to address that design question or whether it would be preferable to keep this PR narrowly scoped to the current behavior gap and discuss the larger attribute-modeling issue separately.
>
> I would be happy to take either direction, but I wanted to check which scope would be preferred before pushing this further :)
Thank you! It's a bit unclear what we should do here. `[[clang::lifetimebound]]` is 8 years old (https://github.com/llvm/llvm-project/commit/f4e248c23e05e374910a8becbb91f5d3d7a76a01). `[[clang::lifetime_captured_by]]` is two years old (https://github.com/llvm/llvm-project/commit/3e20bae827c0a314142fea74aa3d7ead039fab3d). So these attributes have been out in the wild for a while now and so I'm not certain if we're in "deprecate and replace these" territory or we're in "change the behavior" territory, or something else.
It doesn't make much sense to redistribute to the function type if we actually want this to be handled via declaration attributes rather than type ones. Btw, the type attribute situation has another oddity that's probably a bug: https://godbolt.org/z/be6WfPEqx which is another behavior that would make more sense if this were a declaration attribute instead.
CC @usx95 @zygoloid
https://github.com/llvm/llvm-project/pull/192070
More information about the cfe-commits
mailing list