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]

g++ internal compiler error: from bad template def.



  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.


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