mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-08 18:57:49 +08:00
* pt.c (tsubst_copy): Call tsubst for TYPEOF_EXPR.
From-SVN: r46772
This commit is contained in:
parent
5f850402c7
commit
2a2b1d56d3
@ -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.
|
||||
|
@ -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);
|
||||
|
||||
|
21
gcc/testsuite/g++.dg/ext/typeof1.C
Normal file
21
gcc/testsuite/g++.dg/ext/typeof1.C
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user