This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ internal compiler error: from bad template def.
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: g++ internal compiler error: from bad template def.
- From: Ian Nixon <ian at tharas dot com>
- Date: Fri, 16 Jul 1999 08:45:44 -0700
Using:
Reading specs from
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
The following (erroneous) code:
struct A {};
template<class M, class T = A, class C> class Tc {};
main ()
{
Tc<int> oops;
}
produces:
g++ code.cc -o code
code.cc: In function `int main()':
code.cc:8: Internal compiler error.
code.cc:8: Please submit a full bug report to
`egcs-bugs@egcs.cygnus.com'.
code.cc:8: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for
details.
My reading of the draft standard (at least the one I have) would lead
me to believe that the code above is wrong and should be flagged as
such.
Adding a default to C removes the problem.
Thanks
Ian.