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

g++.bob/inherit1 (Was: wrong error for G++ test suite case)


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;


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