This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
using-declaration and access control
- To: egcs-bugs at cygnus dot com
- Subject: using-declaration and access control
- From: Dallas Morlock <dallas at daktel dot com>
- Date: Fri, 06 Feb 1998 17:41:59 +0000
egcs doesn't accept this code from Stroustrup3, Section 15.3.2.2.
egcs correctly finds the error on LINE 12, but the error message points
to
LINE 3 as the source of the problem. This could be confusing for large
files.
Also, egcs incorrectly diagnoses LINE 13 as an error.
------
class B {
private:
int a; // LINE 3
protected:
int b; // LINE 5
public:
int c;
};
class D : public B {
public:
using B::a; // error: B::a is private LINE 12
using B::b; // make B::b publically available through D LINE 13
};
------
$ g++ -v
Reading specs from
/mnt/space/egcs-980205/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.9
1.07/specs
gcc version egcs-2.91.07 980205 (gcc-2.8.0 release)
$ g++ -c UsingTest.cc
UsingTest.cc:3: cannot make private `B::a' non-private
UsingTest.cc:5: cannot make protected `B::b' non-protected
---
Dallas Morlock
dallas@daktel.com