crash when friend function defines template specialization
Alexandre Oliva
oliva@dcc.unicamp.br
Tue Feb 24 21:02:00 GMT 1998
Ian Haggard writes:
> I was able to further refine my example program. The following (even smaller)
> program gives me an internal compiler error:
It doesn't with the latest snapshot of egcs. However, this code is
ill-formed, as of the C++ Standard (Dec'97) [temp.expl.spec]
20An explicit specialization declaration shall not be a friend declara-
tion.
Although your code does not use the appropriate syntax for an explicit
specialization, it is one, and egcs accepts that as an extension for
backward compatibility.
The template function must be defined outside the template class
body.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc-bugs
mailing list