This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH to c++/35325
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 21 Apr 2008 13:58:38 -0400
- Subject: C++ PATCH to c++/35325
Just needed to copy FIXED_CST handling from operand_equal_p.
Tested x86_64-pc-linux-gnu, applied to trunk and 4.3.
2008-04-21 Jason Merrill <jason@redhat.com>
PR c++/35325
* tree.c (cp_tree_equal): Handle FIXED_CST.
Index: cp/tree.c
===================================================================
*** cp/tree.c (revision 134514)
--- cp/tree.c (working copy)
*************** cp_tree_equal (tree t1, tree t2)
*** 1734,1739 ****
--- 1734,1743 ----
&& !memcmp (TREE_STRING_POINTER (t1), TREE_STRING_POINTER (t2),
TREE_STRING_LENGTH (t1));
+ case FIXED_CST:
+ return FIXED_VALUES_IDENTICAL (TREE_FIXED_CST (t1),
+ TREE_FIXED_CST (t2));
+
case COMPLEX_CST:
return cp_tree_equal (TREE_REALPART (t1), TREE_REALPART (t2))
&& cp_tree_equal (TREE_IMAGPART (t1), TREE_IMAGPART (t2));
Index: testsuite/g++.dg/ext/fixed1.C
===================================================================
*** testsuite/g++.dg/ext/fixed1.C (revision 0)
--- testsuite/g++.dg/ext/fixed1.C (revision 0)
***************
*** 0 ****
--- 1,7 ----
+ // PR c++/35325
+
+ template<int> struct A {};
+
+ template<typename> struct B : A<sizeof(0=0r)> {};
+
+ template<typename> struct C : A<sizeof(0=0r)> {};