Merge with main truk.
[official-gcc.git] / gcc / testsuite / g++.dg / init / reference2.C
blob42f5374268581809da17be7d252db3adfbdf2a86
1 // { dg-do compile }
2 // This code used to be accepted but it is invalid as there is no
3 // value initialization of a reference type.
4 // PR c++/36695
6 // We should we able to diagnostic this without instantiating the template
7 template <int a1>
8 int f()
10   typedef int& T;
11   T a = T();  // { dg-error "value-initialization of reference" }