OSDN Git Service

PR c++/48969
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / init / reference3.C
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
5
6 template <typename T>
7 T f()
8 {
9   T a = T();  // { dg-error "value-initialization of reference" }
10 }
11
12 int &a = f<int&>(); // { dg-message "required from here" }
13