This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

EGCS asked for it


While compiling this text:
==========================================
template<class T,int n> T factorial()
{
 return factorial<T,n-1>() * T(n);
}

template<class T,int n> T factorial<T,2>()
{              // this is line 7
 return T(2);
}

int main()
{
 int a = factorial<int,10>();
}
==========================================
I get 
templ.cpp:7: Internal compiler error.
templ.cpp:7: Please submit a full bug report to `egcs-bugs@cygnus.com'.

Line 7 is marked.

g++ --version yields: egcs-2.90.29 980515 (egcs-1.0.3 release)

I suspect I am doing something wrong.  Please help me figure out what.

Thank you.

Victor
--
Phone (415) 878-4261, 9 a.m. - 5 p.m. Pacific Time


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]