This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52379] New: When inheriting a class X from another namespace, inside the class X will always refer to that one.
- From: "yose at jormy dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 25 Feb 2012 11:02:05 +0000
- Subject: [Bug c++/52379] New: When inheriting a class X from another namespace, inside the class X will always refer to that one.
- Auto-submitted: auto-generated
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)