================ @@ -269,6 +269,26 @@ void init_capture_init_list() { // CHECK: } } +void check_dr1815() { // dr1815: yes +#if __cplusplus >= 201402L + + struct A { + int &&r = 0; + ~A() {} + }; + + struct B { + A &&a = A{}; + ~B() {} + }; + + // CHECK: void @_Z12check_dr1815v() + // CHECK: call void @_ZZ12check_dr1815vEN1BD1Ev( + // CHECK: call void @_ZZ12check_dr1815vEN1AD1Ev( + B a = {}; ---------------- zygoloid wrote:
This check of destructor ordering is a bit too subtle for my tastes. How about: ```suggestion // CHECK: void @_Z12check_dr1815v() B a = {}; // CHECK: call {{.*}}some_other_function extern void some_other_function(); some_other_function(); // CHECK: call void @_ZZ12check_dr1815vEN1BD1Ev( // CHECK: call void @_ZZ12check_dr1815vEN1AD1Ev( ``` ... to really drive home that the `A` temporary isn't destroyed until the end of the function? https://github.com/llvm/llvm-project/pull/87933 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits