This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/6479: access control bug
- From: kunert at physik dot tu-dresden dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 26 Apr 2002 18:04:42 -0000
- Subject: c++/6479: access control bug
- Reply-to: kunert at physik dot tu-dresden dot de
>Number: 6479
>Category: c++
>Synopsis: access control bug
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Apr 26 11:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Thomas Kunert
>Release: gcc version 3.1 20020423
>Organization:
>Environment:
$ /opt/bin/g++-31 -v
Reading specs from /opt/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc/configure i686-pc-linux-gnu --enable-shared --prefix=/opt --enable-languages=c,c++,f77
Thread model: single
gcc version 3.1 20020423 (prerelease)
>Description:
The following code is being rejected.
This is a regression from 3.0.
class A {
protected:
A& operator=( const A& a ) { return *this; }
};
class B : public A
{};
int main()
{
B x;
B y;
x = y;
}
$ /opt/bin/g++-31 x2.cc
x2.cc: In member function `B& B::operator=(const B&)':
x2.cc:3: `A& A::operator=(const A&)' is protected
x2.cc:13: within this context
class B : public A
{};
int main()
{
B x;
B y;
x = y;
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: