re PR c++/35325 (ICE with fixed-point types in template parameter)
authorJason Merrill <jason@redhat.com>
Mon, 21 Apr 2008 17:58:53 +0000 (13:58 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 21 Apr 2008 17:58:53 +0000 (13:58 -0400)
        PR c++/35325
        * tree.c (cp_tree_equal): Handle FIXED_CST.

From-SVN: r134519

gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/fixed1.C [new file with mode: 0644]

index 09b2e08f0a5fa40585891343372dc61a0ea95d8f..1ea373332369a271d5f69e6504c1d72596b9b12a 100644 (file)
@@ -1,5 +1,8 @@
 2008-04-21  Jason Merrill  <jason@redhat.com>
 
+       PR c++/35325
+       * tree.c (cp_tree_equal): Handle FIXED_CST.
+
        PR c++/35678
        * pt.c (template_template_parm_bindings_ok_p): Set 
        processing_template_decl while in this function.
index 73adbb50725125c867609cf08614757c317cb7b5..ff372206ee673c012d6836c69812a1cdb2518fa6 100644 (file)
@@ -1734,6 +1734,10 @@ cp_tree_equal (tree t1, tree t2)
        && !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 dca56d962bba68eab00e14a6e7288902d1f79f98..64416f4068fe895672b71d5e5f92f730c3999e11 100644 (file)
@@ -1,5 +1,8 @@
 2008-04-21  Jason Merrill  <jason@redhat.com>
 
+       PR c++/35325
+       * g++.dg/ext/fixed1.C: New.
+
        PR c++/35678
        * g++.dg/template/ttp27.C: New.
 
diff --git a/gcc/testsuite/g++.dg/ext/fixed1.C b/gcc/testsuite/g++.dg/ext/fixed1.C
new file mode 100644 (file)
index 0000000..db074a3
--- /dev/null
@@ -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)> {};