This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ "using" overload bug in 1.1 and mainline
- To: egcs-bugs at cygnus dot com
- Subject: C++ "using" overload bug in 1.1 and mainline
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Fri, 18 Sep 1998 10:28:38 -0500 (CDT)
Someone just pointed this out in comp.lang.c++ ... almost verbatim from
D&E I believe.
class A
{
public:
void f(int);
};
class B : public A
{
public:
using A::f;
void f(long);
};
% gcc -c -v ns-overload-bug.cc
Reading specs from
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/cpp -lang-c++
-v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91
-D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix
-D__linux -Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686
-D__i686__ -D__pentiumpro -D__pentiumpro__ ns-overload-bug.cc
/tmp/cch5nBXp.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/egcs/include/g++
/usr/local/include
/usr/local/egcs/i686-pc-linux-gnu/include
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/include
/usr/include
End of search list.
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.57/cc1plus
/tmp/cch5nBXp.ii -quiet -dumpbase ns-overload-bug.cc -version -o
/tmp/ccG3cBuH.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
(i686-pc-linux-gnu) compiled by GNU C version egcs-2.91.57 19980901
(egcs-1.1 release).
ns-overload-bug.cc:12: cannot adjust access to `void A::f(int)' in `class B'
ns-overload-bug.cc:11: because of local method `void B::f(long int)' with same name
Regards,
Mumit