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]

(gcc 2.95.2 NT4 SP6) using declaration to avoid hiding base class methods


Hi

I am using gcc 2.95.2 on Windows NT4 SP6.

When I compile the following program:

struct A
{
  void f();
  void f(int);
};

struct B : A
{
  using A::f;
  void f(int);
};

int main()
{
  B b;
  b.f();
}


, I get:

using.cpp:11: cannot adjust access to `void A::f(int)' in `struct B'
using.cpp:10:   because of local method `void B::f(int)' with same name
using.cpp: In function `int main()':
using.cpp:16: no matching function for call to `B::f ()'
using.cpp:10: candidates are: void B::f(int)

(where line #11 is the using declaration and line #16 the call b.f()).

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