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-error "exceeds maximum" "exceeds" { target *-*-* } 8 }
10 return f()*I; // { dg-message "instantiated" "recurse" }
14 template <> struct F<52>
16 int operator()() { return 0; }
22 return f(); // { dg-message "instantiated from here" "excessive recursion" }
25 // Ignore excess messages from recursion.
26 // { dg-prune-output "instantiated from 'int" }