aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c10
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ext/typeof7.C6
4 files changed, 21 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index acc0bd4..840b19f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 97a7d78..78c2b13 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9b08ce9..c9444da 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..6c42693
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/typeof7.C
@@ -0,0 +1,6 @@
+// PR c++/13635
+// { dg-options "" }
+
+template<int n> class X {template<class Y> typeof(Y::y) foo();};
+X<0> x;
+