1 // Test for handling of excessive template recursion.
2 // { dg-options "-ftemplate-depth-50 -O" }
4 template <int I> struct F
8 F<I+1> f; // { dg-error "incomplete type" "incomplete" }
9 // { dg-bogus "exceeds maximum.*exceeds maximum" "exceeds" { xfail *-*-* } 8 }
10 // { dg-error "exceeds maximum" "exceeds" { xfail *-*-* } 8 }
11 return f()*I; // { dg-message "instantiated" "recurse" }
12 // { dg-message "skipping 40 instantiation contexts" "" { target *-*-* } 11 }
16 template <> struct F<52>
18 int operator()() { return 0; }
24 return f(); // { dg-message "instantiated from here" "excessive recursion" }
27 // Ignore excess messages from recursion.
28 // { dg-prune-output "instantiated from 'int" }