URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [template/] [pr23510.C] - Rev 307
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do compile }
// { dg-options "-ftemplate-depth-15" }
template<unsigned int nFactor>
struct Factorial
{
enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth exceeds maximum" }
// { dg-message "skipping 5 instantiation contexts" "" { target *-*-* } 6 }
// { dg-error "incomplete type" "" { target *-*-* } 6 }
}
template<> // { dg-error "expected" }
struct Factorial<0>
{
enum { nValue = 1 };
}
static const unsigned int FACTOR = 20;
int main()
{
Factorial<FACTOR>::nValue;
return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log