c++/8205: using declaration doesn't work while mulitiple inheritance was used.

hou_zhenyu@hotmail.com hou_zhenyu@hotmail.com
Fri Oct 11 20:56:00 GMT 2002


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



More information about the Gcc-bugs mailing list