OSDN Git Service

PR c++/13635
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Jan 2004 00:47:59 +0000 (00:47 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Jan 2004 00:47:59 +0000 (00:47 +0000)
* pt.c (tsubst): Use finish_typeof.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76131 138bc75d-0d04-0410-961f-82ee72b054a4

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

index acc0bd4..840b19f 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 97a7d78..78c2b13 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 9b08ce9..c9444da 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;
+