aeft wrote:
> Good catch. Was there any failing test through which you found this ?
No. I will add a new test:
```cpp
struct A {
A();
~A();
A &operator=(const A &);
};
struct B {
B();
~B();
};
struct C {
C();
~C();
};
A &getLHS(const B &);
A &getRHS(const C &);
// CHECK-LABEL: void test_temp_dtor_order()
// CHECK: ~B() (Temporary object destructor)
// CHECK-NEXT: ~C() (Temporary object destructor)
void test_temp_dtor_order() {
getLHS(B()) = getRHS(C());
}
```
https://github.com/llvm/llvm-project/pull/181113
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits