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]

[3.3 PATCH] PR c++/11409: Backport from mainline


The following patch is a backport from mainline CVS of my fix to
PR c++/11409, which is a tweak to resolve_address_of_overloaded_function
to ignore anticipated declarations.  The original patch was posted
here http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00355.html and
has been on mainline without problems for nearly a month.

The following patch has been tested against gcc-3_3-branch with a full
"make bootstrap" on i686-pc-linux-gnu, all languages except treelang,
and regression tested with a top-level "make -k check" with no new
failures.

Ok for the 3.3 branch?


2003-10-04  Roger Sayle  <roger@eyesopen.com>

	PR c++/11409
	* class.c (resolve_address_of_overloaded_function): When building
	list of matching non-template function decls, ignore anticipated
	declarations of undeclared or shadowed GCC builtins.

	* g++.dg/overload/builtin3.C: New test case.


Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
retrieving revision 1.499.2.23
diff -c -3 -p -r1.499.2.23 class.c
*** class.c	18 Sep 2003 17:26:05 -0000	1.499.2.23
--- class.c	4 Oct 2003 04:12:54 -0000
*************** cannot resolve overloaded function `%D'
*** 6103,6109 ****
  	    /* We're looking for a non-static member, and this isn't
  	       one, or vice versa.  */
  	    continue;
!
  	  /* See if there's a match.  */
  	  fntype = TREE_TYPE (fn);
  	  if (is_ptrmem)
--- 6103,6113 ----
  	    /* We're looking for a non-static member, and this isn't
  	       one, or vice versa.  */
  	    continue;
!
! 	  /* Ignore anticipated decls of undeclared builtins.  */
! 	  if (DECL_ANTICIPATED (fn))
! 	    continue;
!
  	  /* See if there's a match.  */
  	  fntype = TREE_TYPE (fn);
  	  if (is_ptrmem)


// PR c++/11409
// { dg-do compile }

namespace std {
  double fabs (double);
}
using std::fabs;

double (*p) (double) = &fabs;  // { dg-bogus "is ambiguous" "" }


Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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