This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12135] New: [3.4 regression] spurious "int ._0" in error message
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Sep 2003 16:58:16 -0000
- Subject: [Bug c++/12135] New: [3.4 regression] spurious "int ._0" in error message
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12135
Summary: [3.4 regression] spurious "int ._0" in error message
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: diagnostic
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
Compiling the invalid code snippet
--------------------------------------------
inline template <int> void foo () {}
--------------------------------------------
with mainline, I get the following error message:
bug.cc:1: error: expected unqualified-id
bug.cc:1: error: ISO C++ forbids declaration of `type name' with no type
bug.cc:1: error: abstract declarator `int' used as declaration
bug.cc:1: error: explicit instantiation of non-template `int ._0'
bug.cc:1: error: expected `;'
which is bogus. The worst part is "int ._0" which is nowhere to be
seen in the code. The rest isn't very helpful either.
Previous versions of gcc just gave a simple
bug.cc:1: error: parse error before `<' token
which isn't very elaborate, but not as confusing as mainline's message.
Btw, 3.3 branch issues an ICE when compiling the following code
(one can use any name of a builtin instead of abort):
--------------------------------------------
inline template <int> void foo () {}
void abort ();
--------------------------------------------
The error message then is:
bug.cc:1: error: parse error before `<' token
bug.cc:3: internal compiler error: in lookup_template_function, at
cp/pt.c: 4002
Please submit a full bug report, [etc.]
But since this is an error-recovery problem which is fixed on mainline,
there's nothing more to do about the ICE.