This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]