This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: eb125
- To: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Subject: Re: eb125
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 01 Jun 1998 10:51:25 -0300
- Cc: egcs-patches at cygnus dot com
- References: <199806011030.MAA05079@mira.isdn.cs.tu-berlin.de>
Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:
> Index: eb125.C
> ! template void test<> (test_box *); // ERROR - illegal code
Actually, this is perfectly legal code, it is an explicit
instantiation of the previously declared template function test.
However, because of the lack of a semicolon after the declaration of
class test_square, the definition of the template function test is not
parsed correctly. Perhaps we should mark this as an XFAIL, as it
would be best if egcs++ accepted the template function declaration
even after a class declaration missing the ending semicolon.
Furthermore, there's no reason to include all the iostream headers in
the test, and this might even cause trouble (i.e., unexpected
warnings) on platforms where ptrdiff_t, size_t, etc, are defined any
different from the included code. They should either be replaced with
#include <iostream.h> or completely deleted (as long as
test_box::print is only declared; removing its implementation does not
affect the test case).
Sorry for not providing a patch myself.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil