This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16891] New: Ambiguity ??
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Aug 2004 01:58:02 -0000
- Subject: [Bug c++/16891] New: Ambiguity ??
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
class B1 {
void Foo() {}
};
struct B2 {
void Foo() {}
}
struct D : public B1, public B2 {
void Bar() { Foo(); }
};
int main() {
D d;
return 0;
}
gets you:
foo.cc: In member function `void D::Bar()':
foo.cc:8: error: reference to `Foo' is ambiguous
foo.cc:5: error: candidates are: void B2::Foo()
foo.cc:2: error: void B1::Foo()
foo.cc:8: error: `Foo' undeclared (first use this function)
foo.cc:8: error: (Each undeclared identifier is reported only once for each function it appears in.)
foo.cc: At global scope:
foo.cc:9: error: multiple types in one declaration
However, only one of the Foo's is visible. Where's the ambiguity?
Ivan
--
Summary: Ambiguity ??
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16891