PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / init / reference2.C
blob903c06496d5cdbe69a9a6ba886b62c313247953a
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 void f()
10   typedef int& T;
11   T a = T();  // { dg-error "value-initialization of reference" }