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]

Bug report: Access scope


The following program:
#include <iostream>

struct A
{
  void function() {  cout << __PRETTY_FUNCTION__ << endl; }
};

struct B : public A
{
  void function() {  cout << __PRETTY_FUNCTION__ << endl; }
};

struct C : protected B
{
  A::function;
};

int main(...)
{
  C c;
  c.function();
}

Reports:
scopechange.cpp: In function `int main(...)':
scopechange.cpp:10: `void B::function()' is inaccessible
scopechange.cpp:21: within this context

Under:
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)

Thank you.

begin:vcard 
n:Bouchard;Philippe
x-mozilla-html:FALSE
org:Corel Linux
adr:;;;;;;
version:2.1
email;internet:philippeb@corel.com
title:Software Engineer
x-mozilla-cpt:;0
fn:Philippe Bouchard
end:vcard

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