This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20576] poor diagnostic
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Mar 2005 12:39:28 -0000
- Subject: [Bug c++/20576] poor diagnostic
- References: <20050321122530.20576.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From igodard at pacbell dot net 2005-03-21 12:39 -------
The same case but using derivation from classes rather than templates:
struct foo {};
struct bar : public foo {};
struct baz : public bar {};
struct baf : public foo, public baz {};
void F(foo&) {}
int main() { baf b; F(b); return 0; }
gives a much better diagnostic:
~/ootbc/members/src$ g++ foo.cc
foo.cc:4: warning: direct base `foo' inaccessible in `baf' due to ambiguity
foo.cc: In function `int main()':
foo.cc:6: error: `foo' is an ambiguous base of `baf'
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20576