OSDN Git Service

* g++.dg/template/spec10.C: Set exit value to zero on success. Fix
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / recurse.C
1 // Test for handling of excessive template recursion.
2 // { dg-options "-ftemplate-depth-50 -O" }
3
4 template <int I> struct F
5 {
6   int operator()()
7     {
8       F<I+1> f;                 // { dg-error "" "" }
9       return f()*I;             // { dg-error "" "" }
10     }
11 };
12
13 template <> struct F<52>
14 {
15   int operator()() { return 0; }
16 };
17
18 int main ()
19 {
20   F<1> f;
21   return f();           // { dg-error "instantiate" "excessive recursion" }
22 }