This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50418] New: nested class typedef with same name and pointing to parent class typedef
- From: "frrrwww at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Sep 2011 08:57:39 +0000
- Subject: [Bug c++/50418] New: nested class typedef with same name and pointing to parent class typedef
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50418
Bug #: 50418
Summary: nested class typedef with same name and pointing to
parent class typedef
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: frrrwww@gmail.com
struct A
{
typedef int T;
struct B
{
typedef T T;
};
};
test.cpp:6:19: error: declaration of âtypedef A::T A::B::Tâ
test.cpp:3:17: error: changes meaning of âTâ from âtypedef int A::Tâ
It works with Comeau, Clang and VC++, gcc workaround is the following:
struct A
{
typedef int T;
struct B
{
typedef A::T T;
};
};