Merged r156806 through r156977 into branch.
[official-gcc.git] / gcc / testsuite / g++.dg / template / pr23510.C
bloba0806e245c59f0e3de508e3398d776ef1acab80e
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 exceeds maximum" } 
7   // { dg-message "skipping 5 instantiation contexts" "" { target *-*-* } 6 } 
8   // { dg-error "incomplete type" "" { target *-*-* } 6 } 
9
11   template<> // { dg-error "expected" } 
12   struct Factorial<0>
13   {
14     enum { nValue = 1 };
15   }
17     static const unsigned int FACTOR = 20;
19 int main()
21   Factorial<FACTOR>::nValue;
22   return 0;