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


> > ! 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.

The comment in for the ERROR could have been clearer. This is exactly
the illegal code I'm talking about: The class is not terminated with a
semi-colon. Unfortunately, g++ reports it on the following non-empty
line, so this is where the "expected error" is.

[iostream.h included]
> 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).

This would be a reasonable solution for normal test cases. For these
cases extracted from egcs-bugs, I use the policy to not modify the
source code (except when the change clearly is not affecting the
problem of the original poster).

For this specific case, I assume earlier versions of the compiler used
to crash when compiling it, as the author didn't bother with fixing
the obvious syntax errors.

We don't know anymore what was causing the crash, so the best bet for
making it a regression test is to leave it as-is.

The next best bet is that this is a terrible long code, with little
testing value, so we should just remove it.

Martin


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