OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [infinite1.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// { dg-options "-ftemplate-depth-10" }
3
// Test for catching infinitely recursive instantiations.
4
// Origin: Jason Merrill 
5
 
6
 
7
template  void f()
8
{
9
  f();                  // { dg-error "" } excessive recursion
10
}
11
 
12
// We should never need this specialization because we should issue an
13
// error first about the recursive template instantions.  But, in case
14
// the compiler fails to catch the error, this will keep it from
15
// running forever instantiating more and more templates.
16
template <> void f<11>();
17
 
18
int main()
19
{
20
  f<0>();
21
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.