This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c++/50418] New: nested class typedef with same name and pointing to parent class typedef


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;
    };
};


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