diff options
author | Jason Merrill <jason@redhat.com> | 2000-06-21 12:37:06 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-06-21 12:37:06 -0400 |
commit | 88e1b92a3da5eb3f91b74f27b5fb93f43f0aa596 (patch) | |
tree | 78973f1e3d62f466928253c283f3fc493457f844 | |
parent | f433539a26299e29afa8b0e0b46b36b88a37ca24 (diff) | |
download | gcc-88e1b92a3da5eb3f91b74f27b5fb93f43f0aa596.zip gcc-88e1b92a3da5eb3f91b74f27b5fb93f43f0aa596.tar.gz gcc-88e1b92a3da5eb3f91b74f27b5fb93f43f0aa596.tar.bz2 |
pt.c (tsubst_decl, [...]): Fix test for TYPE_DECLs for which we don't need to look for instantiations.
* pt.c (tsubst_decl, case TYPE_DECL): Fix test for TYPE_DECLs
for which we don't need to look for instantiations.
From-SVN: r34633
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 19 |
2 files changed, 11 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4829b39..f5b4c31 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-06-20 Jason Merrill <jason@redhat.com> + + * pt.c (tsubst_decl, case TYPE_DECL): Fix test for TYPE_DECLs + for which we don't need to look for instantiations. + 2000-06-21 Nathan Sidwell <nathan@codesourcery.com> * parse.y (program): Always call finish_translation_unit. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4250eee..70ad846 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5873,20 +5873,13 @@ tsubst_decl (t, args, type, in_decl) break; case TYPE_DECL: - if (DECL_IMPLICIT_TYPEDEF_P (t)) + if (TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM + || t == TYPE_MAIN_DECL (TREE_TYPE (t))) { - /* For an implicit typedef, we just want the implicit - typedef for the tsubst'd type. We've already got the - tsubst'd type, as TYPE, so we just need it's associated - declaration. */ - r = TYPE_NAME (type); - break; - } - else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM - || TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM) - { - /* For a template type parameter, we don't have to do - anything special. */ + /* If this is the canonical decl, we don't have to mess with + instantiations, and often we can't (for typename, template + type parms and such). Note that TYPE_NAME is not correct for + the above test if we've copied the type for a typedef. */ r = TYPE_NAME (type); break; } |