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]
Other format: [Raw text]

C++ PATCH: PR 7584


This patch fixes high-priority PR 7584.

Tested on i686-pc-linux-gnu, applied on the mainline and the branch.

-- 
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2002-10-17  Mark Mitchell  <mark@codesourcery.com>

	PR c++/7584
	* class.c (handle_using_decl): Allow the declaration used to be
	from an ambiguous base.

2002-10-17  Mark Mitchell  <mark@codesourcery.com>

	PR c++/7584
	* g++.dg/inherit/using3.C: New test.

Index: cp/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
retrieving revision 1.475
diff -c -p -r1.475 class.c
*** cp/class.c	15 Oct 2002 18:06:48 -0000	1.475
--- cp/class.c	17 Oct 2002 22:33:09 -0000
*************** handle_using_decl (using_decl, t)
*** 1155,1163 ****
    tree flist = NULL_TREE;
    tree old_value;
  
!   binfo = binfo_or_else (ctype, t);
    if (! binfo)
!     return;
    
    if (constructor_name_p (name, ctype))
      {
--- 1155,1166 ----
    tree flist = NULL_TREE;
    tree old_value;
  
!   binfo = lookup_base (t, ctype, ba_any, NULL);
    if (! binfo)
!     {
!       error_not_base_type (t, ctype);
!       return;
!     }
    
    if (constructor_name_p (name, ctype))
      {
Index: testsuite/g++.dg/inherit/using3.C
===================================================================
RCS file: testsuite/g++.dg/inherit/using3.C
diff -N testsuite/g++.dg/inherit/using3.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/inherit/using3.C	17 Oct 2002 22:33:09 -0000
***************
*** 0 ****
--- 1,19 ----
+ class A
+ {
+ public:
+     typedef int T;
+     int a;
+ };
+ 
+ class B : virtual private A
+ {
+ };
+ 
+ class C : virtual private A, public B
+ {
+ public:
+     using A::a;
+     using A::T;
+ };
+ 
+ C::T x;


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