This is the mail archive of the gcc-patches@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]

Re: eb125


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



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