This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8205: using declaration doesn't work while mulitiple inheritance was used.
- From: hou_zhenyu at hotmail dot com
- To: gcc-gnats at gcc dot gnu dot org
- Cc: chicares at mindspring dot com
- Date: 12 Oct 2002 03:51:38 -0000
- Subject: c++/8205: using declaration doesn't work while mulitiple inheritance was used.
- Reply-to: hou_zhenyu at hotmail dot com
>Number: 8205
>Category: c++
>Synopsis: using declaration doesn't work while mulitiple inheritance was used.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 11 20:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: hou_zhenyu@hotmail.com
>Release: gcc3.2
>Organization:
>Environment:
mingw2.0 release
>Description:
when multiple non-public base classes are used, using declarations for changing acccessibility of the base classes members have no effect. When access such members in client code, the compiler reports:
'Base' is an inaccessible base of 'Heir'
>How-To-Repeat:
class A { public: int i; };
class B {};
class D : A { public: using A::i; };
class E : A, B { public: using A::i; };
int main()
{
D d;
d.i;
E e;
e.i; // "`A' is an inaccessible base of `E'"
}
>Fix:
None. Change private inheritance to public inheritance can work, but it breaks the semantic.
>Release-Note:
>Audit-Trail:
>Unformatted: