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, committed] Fix PR8849


Hi

I am committing the following obvious patch to both 3.3 and trunk.
In 'resolve_overloaded_unification', we forget to handle
FUNCTION_DECL causing GCC to call 'abort' later in the function.
This is a regression from GCC 3.2.  Patch tested on i686-pc-linux-gnu.

2003-01-31  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	PR c++/8849
	* pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL.

2003-01-31  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	PR c++/8849
	* g++.dg/template/ptrmem4.C: New test.


diff -cprN gcc-33-save/gcc/cp/pt.c gcc-33-new/gcc/cp/pt.c
*** gcc-33-save/gcc/cp/pt.c	Tue Jan 28 21:42:44 2003
--- gcc-33-new/gcc/cp/pt.c	Fri Jan 31 22:06:40 2003
*************** resolve_overloaded_unification (tparms, 
*** 8378,8384 ****
  	    }
  	}
      }
!   else if (TREE_CODE (arg) == OVERLOAD)
      {
        for (; arg; arg = OVL_NEXT (arg))
  	{
--- 8378,8385 ----
  	    }
  	}
      }
!   else if (TREE_CODE (arg) == OVERLOAD
! 	   || TREE_CODE (arg) == FUNCTION_DECL)
      {
        for (; arg; arg = OVL_NEXT (arg))
  	{
diff -cprN gcc-33-save/gcc/testsuite/g++.dg/template/ptrmem4.C gcc-33-new/gcc/testsuite/g++.dg/template/ptrmem4.C
*** gcc-33-save/gcc/testsuite/g++.dg/template/ptrmem4.C	Thu Jan  1 07:00:00 1970
--- gcc-33-new/gcc/testsuite/g++.dg/template/ptrmem4.C	Fri Jan 31 22:54:08 2003
***************
*** 0 ****
--- 1,20 ----
+ // { dg-do compile }
+ 
+ // Origin: Scott Snyder <snyder@fnal.gov>
+ 
+ // PR c++/8849
+ // Pointer to member function template argument deduction ICE.
+ 
+ 
+ template <class CONT> void queryAliases(CONT& fill_me);
+ 
+ struct SpyExample
+ {
+   void ready();
+   void inputs();
+ };
+ 
+ void SpyExample::ready()
+ {
+   queryAliases(inputs);
+ }


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