* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / pr78890-2.C
blob0a11bf4bc62ad1dbe68b8f307a5de3dbfeb6f661
1 // PR c++/78890
2 // { dg-do compile { target c++11 } }
4 template <typename T>
5 int
6 foo ()
8   union {
9     int a;
10     int &b = a;                 // { dg-error "may not have reference type" }
11   };
12   a = 1;
13   auto c = b + 1;
14   return c;
17 template <typename T>
19 bar ()
21   union {
22     T a;
23     T &b = a;                   // { dg-error "may not have reference type" }
24   };
25   a = 1;
26   auto c = b + 1;
27   return c;
30 template <typename T, typename U>
31 T baz()
33   union {
34     T a;
35     U b = a;                    // { dg-error "may not have reference type" }
36   };
37   a = 1;
38   auto c = b + 1;
39   return c;
42 int a = foo<int> ();
43 int b = bar<int> ();
44 int c = baz<int, int &> ();