Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / template / pr23510.C
blob1c3180f8331fdcf9b8596b7f209350959ed8b884
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 "recursively instantiated" "" { target *-*-* } 6 } 
8   // { dg-error "incomplete type" "" { target *-*-* } 6 } 
9 } // { dg-error "expected ';' after" }
11   template<>
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;