This is the mail archive of the gcc@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]

`using base::member;' does not work



The sample comes from the B. Stroustrup's book
"The Design and Evolution of C++".

It does make the B::f member function available
for class D trough the using directive.

The egcs-1.1 doesn't compile this sample.
eg++ main.cc
main.cc:15: cannot adjust access to `void B::f(char)' in `class D'
main.cc:13:   because of local method `void D::f(int)' with same name


# include <iostream.h>

class B {
  public:
    void f(char c) {cout << c << '\n';}
};

class D : public B {
  public:
    void f(int c) {cout << c << '\n';}   // line 13
    using B::f;
};

int main()
{
  D d;
  d.f('x');
}

My configuration:
Linux (RedHat 5.1), Pentium II
egcs-1.1


Ryszard Kabatek

Martin-Luther University Halle-Wittenberg
Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 Fax. +49 3461 46 2129
e-mail: kabatek@chemie.uni-halle.de



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