1 // { dg-do compile { target c++11 } } 2 3 struct S { void *p; }; 4 struct T { S s; }; 5 constexpr S s = { nullptr }; 6 constexpr T t = { { nullptr } }; 7 8 constexpr void * foo()9foo () 10 { 11 return ((void **) &t)[0]; // { dg-error "reinterpret_cast" } 12 } 13 14 constexpr void * bar()15bar () 16 { 17 return ((void **) &s)[0]; // { dg-error "reinterpret_cast" } 18 } 19 20 constexpr auto x = foo (); 21 constexpr auto y = bar (); 22