Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/pr23510.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do compile } |
2 // { dg-options "-ftemplate-depth-15" } | |
3 template<unsigned int nFactor> | |
4 struct Factorial | |
5 { | |
6 enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth" } | |
7 }; | |
8 | |
9 template<> | |
10 struct Factorial<0> | |
11 { | |
12 enum { nValue = 1 }; | |
13 }; | |
14 | |
15 static const unsigned int FACTOR = 20; | |
16 | |
17 int main() | |
18 { | |
19 Factorial<FACTOR>::nValue; // { dg-message "from here" } | |
20 return 0; | |
21 } | |
22 | |
23 // { dg-prune-output "compilation terminated" } |