* pt.c (tsubst_copy): Call tsubst for TYPEOF_EXPR.

From-SVN: r46772
This commit is contained in:
Kriang Lerdsuwanakij 2001-11-04 09:50:44 +00:00 committed by Kriang Lerdsuwanakij
parent 5f850402c7
commit 2a2b1d56d3
3 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2001-11-04 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* pt.c (tsubst_copy): Call tsubst for TYPEOF_EXPR.
2001-11-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* lex.c (copy_lang_type): Add static prototype.

View File

@ -7174,6 +7174,7 @@ tsubst_copy (t, args, complain, in_decl)
case ARRAY_TYPE:
case TYPENAME_TYPE:
case UNBOUND_CLASS_TEMPLATE:
case TYPEOF_TYPE:
case TYPE_DECL:
return tsubst (t, args, complain, in_decl);

View File

@ -0,0 +1,21 @@
// Test typeof template argument substitution
// Copyright (C) 2001 Free Software Foundation
// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
// { dg-do compile }
// { dg-options "" }
template <class T> struct A {
void f() {}
void g(T* t) {
A<typeof(t)> a;
a.f();
}
};
int main()
{
A<int> a;
int b;
a.g(&b);
}