This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46687] Class member lookup ambiguity w/ overloaded static members and using declarations
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 28 Nov 2010 01:57:13 +0000
- Subject: [Bug c++/46687] Class member lookup ambiguity w/ overloaded static members and using declarations
- Auto-submitted: auto-generated
- References: <bug-46687-4@http.gcc.gnu.org/bugzilla/>
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