This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH, committed] Fix PR8849
- From: Kriang Lerdsuwanakij <lerdsuwa at users dot sourceforge dot net>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 31 Jan 2003 23:02:35 +0700 (ICT)
- Subject: [C++ PATCH, committed] Fix PR8849
- Reply-to: <lerdsuwa at users dot sourceforge dot net>
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);
+ }