================
@@ -75,6 +75,18 @@ namespace usage_ok {
r = A(1); // expected-warning {{object backing the pointer 'r' will be
destroyed at the end of the full-expression}}
}
+ // Test that lifetimebound on implicit 'this' is propagated across
redeclarations
+ struct B {
+ int *method() [[clang::lifetimebound]];
+ int i;
+ };
+ int *B::method() { return &i; }
----------------
cor3ntin wrote:
Can you add a test for that?
```cpp
struct B {
int *method();
int i;
};
int *B::method() [[clang::lifetimebound]]; { return &i; }
```
https://github.com/llvm/llvm-project/pull/172146
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits