ipa-cp: Perform operations in the appropriate types (PR 118097)
[gcc.git] / gcc / testsuite / g++.dg / template / anonunion3.C
blob6ab7d1007640c8a7dac2df24e74fe338b5ea729a
1 // PR c++/86182
2 // { dg-do compile { target c++11 } }
4 extern "C" int printf (const char *, ...);
6 template<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";
13 int main() {
14  union { char const *x = f(this); };
15  printf("%s\n", x);