Commit 6c21456c by Jason Merrill

specify template depth

From-SVN: r48753
parent 04894c5a
// Test for catching infinitely recursive instantiations. // Test for catching infinitely recursive instantiations.
// Origin: Jason Merrill <jason@redhat.com> // Origin: Jason Merrill <jason@redhat.com>
// Special g++ Options: -ftemplate-depth-10
template <int i> void f() template <int i> void f()
{ {
f<i+1>(); // ERROR - excessive recursion f<i+1>(); // ERROR - excessive recursion
...@@ -10,7 +12,7 @@ template <int i> void f() ...@@ -10,7 +12,7 @@ template <int i> void f()
// error first about the recursive template instantions. But, in case // error first about the recursive template instantions. But, in case
// the compiler fails to catch the error, this will keep it from // the compiler fails to catch the error, this will keep it from
// running forever instantiating more and more templates. // running forever instantiating more and more templates.
template <> void f<100>(); template <> void f<11>();
int main() int main()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment