Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/sfinae2.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/19989 |
2 // Don't instantiate a function template if it would generate an | |
3 // array of size zero. | |
4 | |
5 // { dg-do compile } | |
6 | |
7 template<int T> struct cl { | |
8 const static int value = T; | |
9 }; | |
10 | |
11 template<int I> void fn (char (*) [cl<I>::value] = 0 ); // { dg-error "zero-size array" } | |
12 | |
13 void foo (void) | |
14 { | |
15 fn<0> (); // { dg-error "no matching function" } | |
16 } | |
17 |