Skip to content

add [[clang::lifetimebound]] annotations where possible - #269

Merged
tzcnt merged 1 commit into
mainfrom
lifetimebound
Jul 11, 2026
Merged

tzcnt merged 1 commit into
mainfrom
lifetimebound

Conversation

@tzcnt

@tzcnt tzcnt commented Jul 11, 2026 •

Copy link
Copy Markdown
Owner

Clang 23 adds several new diagnostic warnings (-Wlifetime-safety class) that can detect certain classes of dangling references. This warning suggests to add [[clang::lifetimebound]] to a number of methods that reference object or this parameters. To maintain the goal of building TMC + examples/tests without any warnings, I've added these attributes in TMC.

This should be backward compatible; it only serves to detect invalid usage (dangling references). If you're not building with Clang 23+, it will be inert.

@tzcnt
tzcnt merged commit fb629b8 into main Jul 11, 2026
57 of 64 checks passed
@tzcnt
tzcnt deleted the lifetimebound branch July 11, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant