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++/17314] bad error


------- 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


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