re PR c++/13635 (ICE in register_specialization for specific order of template specia...
authorMark Mitchell <mark@codesourcery.com>
Mon, 19 Jan 2004 00:47:59 +0000 (00:47 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 19 Jan 2004 00:47:59 +0000 (00:47 +0000)
PR c++/13635
* pt.c (tsubst): Use finish_typeof.

PR c++/13635
* g++.dg/ext/typeof7.C: New test.

From-SVN: r76131

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

index acc0bd47647e9b4489d44e397339641a3a246f21..840b19f17699362f17372e4913a6c085ee64a757 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-18  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/13635
+       * pt.c (tsubst): Use finish_typeof.
+
 2004-01-16  Jason Merrill  <jason@redhat.com>
 
        PR c++/11725
index 97a7d7852f933f4dadd315d8f76ab450769b0dc2..78c2b1348ab576d5a7f52961ae81976d654214f8 100644 (file)
@@ -7106,13 +7106,13 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
 
     case TYPEOF_TYPE:
       {
-       tree e1 = tsubst_expr (TYPE_FIELDS (t), args, complain, in_decl);
-       if (e1 == error_mark_node)
-         return error_mark_node;
+       tree type;
 
-       return cp_build_qualified_type_real (TREE_TYPE (e1),
+       type = finish_typeof (tsubst_expr (TYPE_FIELDS (t), args, complain, 
+                                          in_decl));
+       return cp_build_qualified_type_real (type,
                                             cp_type_quals (t)
-                                            | cp_type_quals (TREE_TYPE (e1)),
+                                            | cp_type_quals (type),
                                             complain);
       }
 
index 9b08ce913bb4b6bf6bafae936f1bbf1b2811f4c0..c9444da800dd5606a1580c2c585238b56261e6d1 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-18  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/13635
+       * g++.dg/ext/typeof7.C: New test.
+
 2004-01-18  David Edelsohn  <edelsohn@gnu.org>
 
        * gcc.dg/array-quals-1.c: xfail on powerpc*-*-aix*.
diff --git a/gcc/testsuite/g++.dg/ext/typeof7.C b/gcc/testsuite/g++.dg/ext/typeof7.C
new file mode 100644 (file)
index 0000000..6c42693
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/13635
+// { dg-options "" }
+
+template<int n> class X {template<class Y> typeof(Y::y) foo();};
+X<0> x;
+