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]

[Bug c++/24658] New: overloaded function lookup in base class fails


Compiler version details:
*************************

gcc -v

Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.4/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada
--disable-checking --libdir=/usr/lib --enable-libgcj
--with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib
--enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.4 (pre 3.3.5 20040809)



Sample code producing the error:
********************************

class A{};
class B{};

class C
{
public:
  int f(A){return 4;}

};

class D : public C
{
public:
  int f(B){return 4;}
};

int main(int, char **)
{
  D d;
  A a;
  int res = d.f(a);
  return res;
}


Compiler error message:
***********************

test.cpp: In function `int main(int, char**)':
test.cpp:26: error: no matching function for call to `D::f(A&)'
test.cpp:16: error: candidates are: int D::f(B)


-- 
           Summary: overloaded function lookup in base class fails
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: thorsten dot gecks at uni-bayreuth dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24658


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