diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1999-04-12 10:54:06 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-04-12 06:54:06 -0400 |
commit | 802dbc34915da16c5fe637f54d1a18287eabb9d2 (patch) | |
tree | 67a5e4c759c9487c2aaec6fd69f7fdeada5e766c /gcc | |
parent | 660c731419d11aad952688dd1a603e51c3095442 (diff) | |
download | gcc-802dbc34915da16c5fe637f54d1a18287eabb9d2.zip gcc-802dbc34915da16c5fe637f54d1a18287eabb9d2.tar.gz gcc-802dbc34915da16c5fe637f54d1a18287eabb9d2.tar.bz2 |
* pt.c (lookup_template_class): Look through implict typename.
From-SVN: r26370
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index be8c865..992aaa9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +1999-04-12 Jason Merrill <jason@yorick.cygnus.com> + + * pt.c (lookup_template_class): Look through implict typename. + 1999-04-11 Mark Mitchell <mark@codesourcery.com> * friend.c (add_friend): Deal gracefully with error_mark_node. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2988ed6..e8de776 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3581,9 +3581,16 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope) } else if (TREE_CODE (d1) == TYPE_DECL && IS_AGGR_TYPE (TREE_TYPE (d1))) { - if (CLASSTYPE_TEMPLATE_INFO (TREE_TYPE (d1))) + tree type = TREE_TYPE (d1); + + /* If we are declaring a constructor, say A<T>::A<T>, we will get + an implicit typename for the second A. Deal with it. */ + if (TREE_CODE (type) == TYPENAME_TYPE && TREE_TYPE (type)) + type = TREE_TYPE (type); + + if (CLASSTYPE_TEMPLATE_INFO (type)) { - template = CLASSTYPE_TI_TEMPLATE (TREE_TYPE (d1)); + template = CLASSTYPE_TI_TEMPLATE (type); d1 = DECL_NAME (template); } } |