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++/52379] New: When inheriting a class X from another namespace, inside the class X will always refer to that one.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52379

             Bug #: 52379
           Summary: When inheriting a class X from another namespace,
                    inside the class X will always refer to that one.
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: yose@jormy.com


The attached code should compile, but it does not. GCC thinks "a" inside
Two::B::B() refers to One::A, but it should actually be Two::A instead.

Making Two::B not inherit from One::A removes the problem, so it seems to be
related to inheritance.

If there was class C in namespace One, having the object "C a" inside B::B()
will not work on both cases, so it seems to be only affecting that specific
class name.

thanks to _verty for testing this on 4.6.2 as well, but it existed in 4.3.4 as
well (ideone link : http://ideone.com/TpmpM)


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