1 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96157 2 // { dg-do run } 3 // { dg-skip-if "needs gcc/config.d" { ! d_runtime } } 4 5 struct S 6 { 7 @disable this(this); // triggers nrvo 8 int v; 9 } 10 11 __gshared void* p; 12 foo()13S[1000] foo() nothrow 14 { 15 typeof(return) d; 16 p = &d; 17 return d; 18 } 19 main()20void main() 21 { 22 auto d = foo(); 23 assert(p == &d); 24 } 25