[C++ PATCH for 3.3, committed] Fix PR8849

Kriang Lerdsuwanakij lerdsuwa@users.sourceforge.net
Fri Jan 31 16:32:00 GMT 2003


Hi

I forgot to mention in my previous mail that, for 3.3 branch, 
dump_expr couldn't handle BASELINK when output error messages.  
This is the version committed to 3.3 branch.

--Kriang

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

	PR c++/8849
	* error.c (dump_expr): Handle BASELINK.
	* 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/error.c gcc-33-new/gcc/cp/error.c
*** gcc-33-save/gcc/cp/error.c	Fri Jan 24 23:04:15 2003
--- gcc-33-new/gcc/cp/error.c	Fri Jan 31 23:20:10 2003
*************** dump_expr (t, flags)
*** 2048,2053 ****
--- 2048,2057 ----
        output_add_string (scratch_buffer, ") break; ");
        break;
  
+     case BASELINK:
+       print_tree_identifier (scratch_buffer, DECL_NAME (get_first_fn (t)));
+       break;
+ 
      case TREE_LIST:
        if (TREE_VALUE (t) && TREE_CODE (TREE_VALUE (t)) == FUNCTION_DECL)
  	{
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 23:21:17 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); // { dg-error "argument" }
+ 
+ struct SpyExample
+ {
+   void ready();
+   void inputs();
+ };
+ 
+ void SpyExample::ready()
+ {
+   queryAliases(inputs);	// { dg-error "convert" }
+ }



More information about the Gcc-patches mailing list