This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23586] New: [3.4/4.0/4.1 regression] Bad diagnostic for invalid namespace-name
- 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: 26 Aug 2005 22:17:52 -0000
- Subject: [Bug c++/23586] New: [3.4/4.0/4.1 regression] Bad diagnostic for invalid namespace-name
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
For an invalid code snippet like
int i;
namespace N = i;
we issue the error message
bug.cc:2: error: expected namespace-name before ';' token
bug.cc:2: error: unknown namespace '<declaration error>'
with the not very helpful '<declaration error>'.
The situation for the code snippet
int i;
using namespace i;
is similar. Here we get the error message:
bug.cc:2: error: expected namespace-name before ';' token
bug.cc:2: error: '<type error>' is not a namespace
With the old parser we got
bug.cc:2: error: unknown namespace `i'
resp.
bug.cc:2: error: namespace `i' undeclared
so this qualifies as a diagnostic regression.
I'll post a patch soon.
--
Summary: [3.4/4.0/4.1 regression] Bad diagnostic for invalid
namespace-name
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23586