[[clang::lifetimebound]] is ignored in some cases when declaration and definition do not apply the attribute consistently.
The [[clang::lifetimebound]] attribute on a method's implicit object parameter (the this pointer) is not properly detected when:
- A non-template or specialized-template method declaration had the attribute but the out-of-line definition did not
- A template method out-of-line definition had the attribute but the declaration did not
The Godbolt test should show 9 -Wdangling warnings, but currently only shows 6 warnings: https://godbolt.org/z/ra5avj8e4
rdar://167796787
[[clang::lifetimebound]]is ignored in some cases when declaration and definition do not apply the attribute consistently.The
[[clang::lifetimebound]]attribute on a method's implicit object parameter (thethispointer) is not properly detected when:The Godbolt test should show 9
-Wdanglingwarnings, but currently only shows 6 warnings: https://godbolt.org/z/ra5avj8e4rdar://167796787