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.4 PATCH: PR 19034


I backported PR 19034 to the 3.4 branch; no changes from the mainline version.

Tested on x86_64_unknown-linux-gnu, applied to 3.4 branch.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-12-21  Mark Mitchell  <mark@codesourcery.com>

	PR c++/19034
	* tree.c (cp_tree_equal): Handle OVERLOAD.

2004-12-21  Mark Mitchell  <mark@codesourcery.com>

	PR c++/19034
	* g++.dg/template/crash30.C: New test.

Index: testsuite/g++.dg/template/crash30.C
===================================================================
RCS file: testsuite/g++.dg/template/crash30.C
diff -N testsuite/g++.dg/template/crash30.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/template/crash30.C	5 May 2005 05:42:07 -0000
***************
*** 0 ****
--- 1,16 ----
+ // PR c++/19034
+ 
+ template< bool C > struct B
+ {
+ };
+ 
+ template<typename S> int foo();
+ template<typename S> int foo1();
+ 
+ template<typename T> struct bar : public B <(sizeof(foo<T>()) == 1)>
+ {
+ };
+ 
+ template<typename T> struct bar1 : public B <(sizeof(foo1<T>()) == 1)>
+ {
+ };
Index: cp/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
retrieving revision 1.360.4.12
diff -c -5 -p -r1.360.4.12 tree.c
*** cp/tree.c	25 Apr 2005 19:58:27 -0000	1.360.4.12
--- cp/tree.c	5 May 2005 05:42:08 -0000
*************** cp_tree_equal (tree t1, tree t2)
*** 1602,1611 ****
--- 1602,1616 ----
        if (PTRMEM_CST_MEMBER (t1) != PTRMEM_CST_MEMBER (t2))
  	return false;
  
        return same_type_p (PTRMEM_CST_CLASS (t1), PTRMEM_CST_CLASS (t2));
  
+     case OVERLOAD:
+       if (OVL_FUNCTION (t1) != OVL_FUNCTION (t2))
+ 	return false;
+       return cp_tree_equal (OVL_CHAIN (t1), OVL_CHAIN (t2));
+ 
      default:
        break;
      }
  
    switch (TREE_CODE_CLASS (code1))


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