Bug report (or is it?) - private scope
Philippe Bouchard
boucp00@DMI.USherb.CA
Thu Nov 11 09:51:00 GMT 1999
I don't want to say that it is a bug, but it looks a little illogical.
Here's the source:
#include <iostream.h>
class A {
ÃÂ ÃÂ struct B {
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ void func() {
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ cout<<__PRETTY_FUNCTION__<<endl;
}
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ };
ÃÂ ÃÂ };
void main() {
ÃÂ ÃÂ A::B b;
ÃÂ ÃÂ b.func();
ÃÂ ÃÂ }
Everything works and outputs:
void A::B::func()
The members of structure A::B (constructor and void func()) are not
supposed to have limited access to class A?
PAB
More information about the Gcc-bugs
mailing list