This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51543] New: terrible diagnostic for wrong type when expected class or namespace
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Dec 2011 00:49:17 +0000
- Subject: [Bug c++/51543] New: terrible diagnostic for wrong type when expected class or namespace
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51543
Bug #: 51543
Summary: terrible diagnostic for wrong type when expected class
or namespace
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: manu@gcc.gnu.org
Noticed here: http://llvm.org/devmtg/2011-11/Gregor_ExtendingClang.pdf
Testcase:
typedef int N;
N::string str;
gcc 4.7:
namespace.cc:2:11: error: expected initializer before âstrâ
clang 3.0:
namespace.cc:2:1: error: expected a class or namespace
N::string str;
^
clang 3.1:
t.cpp:2:1: error: âNâ (aka âintâ) is not a class or namespace
N::string str;
^
t.cpp:1:13: note: declared here
typedef int N;
^