1// PR c++/68949 2// { dg-do run { target c++11 } } 3 4struct Sub { 5 int i; 6 7 constexpr Sub() : i(-1) {} // remove constexpr and it works as expected 8 Sub(Sub&& rhs); // remove this constructor and it works as epxected. 9}; 10 11// v-- move this inline and it works as expected 12// v-- remove ': Sub()' and it works as expected 13Sub::Sub(Sub&& rhs) : Sub() { int tmp = i; i = rhs.i; rhs.i = tmp; } 14 15struct Class { 16 // v-- remove '[1]' and it works as expected 17 // v-- add '= {}' and it works as expected 18 Sub s[1]; 19 20 // v-- add ': s{}' and it works as expected 21 // v-- removing this constructor makes it work as expected 22 Class() {} 23}; 24 25int main() { 26 Class c; 27 if (c.s[0].i != -1) 28 __builtin_abort(); 29} 30