Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/init/reference2.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
111 | 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 // We should we able to diagnostic this without instantiating the template | |
7 template <int a1> | |
131 | 8 void f() |
111 | 9 { |
10 typedef int& T; | |
145 | 11 T a = T(); // { dg-error "9:invalid value-initialization of reference" } |
111 | 12 } |
13 |