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++/46687] Class member lookup ambiguity w/ overloaded static members and using declarations


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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-11-28 01:57:06 UTC ---
C has two copies of the name A::foo, as B1::foo and B2::foo.

if C only saw A::foo then it would be unambiguous because the same members
would be found, as in this variant:

struct A {
   static int foo();
   static int foo(char);
};

struct B1 : A { };
struct B2 : A { };

struct C : B1, B2 { };

enum { X = sizeof C::foo() };


However, because you have using declarations in B1 and B2 name lookup finds
B1::foo and B2::foo ... at least by my reading, which could be wrong


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