Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/init/reference2.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
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; | |
11 T a = T(); // { dg-error "value-initialization of reference" } | |
12 } | |
13 |