[Bug c++/52379] New: When inheriting a class X from another namespace, inside the class X will always refer to that one.

2012-02-25 Thread yose at jormy dot com
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: unassig...@gcc.gnu.org
ReportedBy: y...@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)


[Bug c++/52379] When inheriting a class X from another namespace, inside the class X will always refer to that one.

2012-02-25 Thread yose at jormy dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52379

--- Comment #1 from Boris von Zuckerberg yose at jormy dot com 2012-02-25 
11:02:45 UTC ---
Created attachment 26751
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=26751
This is the example of the problem in action.