This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17314] bad error
- 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 Sep 2004 21:37:22 -0000
- Subject: [Bug c++/17314] bad error
- References: <20040904040022.17314.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From igodard at pacbell dot net 2004-09-06 21:37 -------
Sure, although if convenient and the message is used only here then it might be
helpful to say why it's private: "virtual base class defaults A::A() to
private" or similar; only saying it's protected that is clearly wrong. For sure
the compiler is detecting that the *inherited* visibility is private to trigger
the error, but the message is then reporting the *declared* visibility, which is
wrong.
In the more common case:
struct A { void Foo(){} };
struct B: private A {};
int main () {
B b;
b.Foo();
}
you get:
~/ootbc/common/test/src$ g++ foo.cc
foo.cc: In function `int main()':
foo.cc:1: error: `void A::Foo()' is inaccessible
foo.cc:5: error: within this context
foo.cc:5: error: `A' is not an accessible base of `B'
which is very good - can't my case plug into the logic that produces this?
Ivan
you get:
Ivan
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17314