[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / template / pr23510.C
blobc1ffc176c5e0f824a2f1d25c72015a8f87260715
1 // { dg-do compile } 
2 // { dg-options "-ftemplate-depth-15" }
3 template<unsigned int nFactor>
4 struct Factorial
6   enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth" } 
7 };
9 template<>
10 struct Factorial<0>
12   enum { nValue = 1 };
15 static const unsigned int FACTOR = 20;
17 int main()
19   Factorial<FACTOR>::nValue;  // { dg-message "from here" }
20   return 0;
23 // { dg-prune-output "compilation terminated" }