================
@@ -40,6 +40,12 @@ namespace usage_ok {
int *p = A().class_member(); // expected-warning {{temporary whose address
is used as value of local variable 'p' will be destroyed at the end of the
full-expression}}
int *q = A(); // expected-warning {{temporary whose address is used as value
of local variable 'q' will be destroyed at the end of the full-expression}}
int *r = A(1); // expected-warning {{temporary whose address is used as
value of local variable 'r' will be destroyed at the end of the
full-expression}}
+
+ void test_assignment() {
----------------
usx95 wrote:
I found a minor case where this does not mirror initialization
```cpp
int *get(const int &x [[clang::lifetimebound]]);
void foo() {
int *y = {get(1)}; // warning as expected.
y = {get(1)}; // no warning.
}
```
This does not look like a commonly occurring pattern but I would be curious why
this misbehaves.
https://github.com/llvm/llvm-project/pull/96475
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits