This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
g++.bob/inherit1 (Was: wrong error for G++ test suite case)
- To: dcb at pncl dot co dot uk
- Subject: g++.bob/inherit1 (Was: wrong error for G++ test suite case)
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sun, 31 May 1998 20:40:23 +0200
- CC: egcs-bugs at cygnus dot com, egcs-patches at cygnus dot com, oliva at dcc dot unicamp dot br
- References: <199805281750.SAA10432@eiger.pncl.co.uk>
I believe David is right here (as usual :-). I'll include a patch for
the testsuite, but I have none for the compiler, so this makes a new
unexpected failure.
Alexandre, could you double-check this?
Martin
Index: g++.bob/inherit1.C
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/testsuite/g++.old-deja/g++.bob/inherit1.C,v
retrieving revision 1.1.1.1
diff -c -p -r1.1.1.1 inherit1.C
*** inherit1.C 1997/08/19 07:34:57 1.1.1.1
--- inherit1.C 1998/05/31 18:28:31
***************
*** 1,4 ****
- // Build don't link:
class A {
char str[10];
public:
--- 1,3 ----
*************** public:
*** 11,20 ****
class B : public A {
public:
! char* m1 () { C::m1(); return ""; } // ERROR -
};
! main () {
A a;
B b;
C c;
--- 10,23 ----
class B : public A {
public:
! /* [class.member.lookup] says that lookup starts from C. Various
! reasons for ambiguity don't apply, as the lookup finds A::m1.
! According to [expr.call], this forms a member call, and overload
! resolution should select A::m1() as the only viable candidate. */
! char* m1 () { C::m1(); return ""; }
};
! int main () {
A a;
B b;
C c;