1 // PR c++/86182 2 // { dg-do compile { target c++11 } } 3 4 extern "C" int printf (const char *, ...); 5 f(T * t)6template<typename T> static char const * f(T *t) { 7 T u(*t); 8 u.x = "hello world"; 9 printf("%s\n", u.x); 10 return "initialized"; 11 } 12 main()13int main() { 14 union { char const *x = f(this); }; 15 printf("%s\n", x); 16 } 17