================ @@ -116,6 +116,7 @@ void foo(int n) { // expected-note {{declared here}} B b2(A(1), {}, 1); // beforecxx20-warning@-1 {{aggregate initialization of type 'A' from a parenthesized list of values is a C++20 extension}} // beforecxx20-warning@-2 {{aggregate initialization of type 'B' from a parenthesized list of values is a C++20 extension}} + // expected-warning@-3 {{temporary whose address is used as value of local variable 'b2' will be destroyed at the end of the full-expression}} ---------------- usx95 wrote:
Can you also add a caae with braced init. https://godbolt.org/z/EaY8Ess3v In that case, this should be valid through lifetime extension. https://github.com/llvm/llvm-project/pull/117690 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits