diff options
author | Mark Mitchell <mark@markmitchell.com> | 1998-07-11 15:42:37 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-07-11 15:42:37 +0000 |
commit | 6b9ab5cc45bfc38ce768e9c472cad34e81c857f7 (patch) | |
tree | aae8d537b4a6f1a9a199b8b6b065c8888b6231fa /gcc | |
parent | 71523737008c14d3e6e0227ed6db74741868d0f0 (diff) | |
download | gcc-6b9ab5cc45bfc38ce768e9c472cad34e81c857f7.zip gcc-6b9ab5cc45bfc38ce768e9c472cad34e81c857f7.tar.gz gcc-6b9ab5cc45bfc38ce768e9c472cad34e81c857f7.tar.bz2 |
pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO for TYPE_DECLs.
* pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO
for TYPE_DECLs.
From-SVN: r21061
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3849f64..eac51c9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1998-07-11 Mark Mitchell <mark@markmitchell.com> + + * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO + for TYPE_DECLs. + 1998-07-08 Vladimir N. Makarov <vmakarov@cygnus.com> * cp-tree.h (warn_long_long): Define. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 32a7715..42caf46 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1808,8 +1808,18 @@ push_template_decl_real (decl, is_friend) if (CLASSTYPE_TEMPLATE_INSTANTIATION (ctx)) cp_error ("must specialize `%#T' before defining member `%#D'", ctx, decl); - if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl)) - tmpl = CLASSTYPE_TI_TEMPLATE (TREE_TYPE (decl)); + if (TREE_CODE (decl) == TYPE_DECL) + { + if (IS_AGGR_TYPE_CODE (TREE_CODE (TREE_TYPE (decl))) + && CLASSTYPE_TEMPLATE_INFO (TREE_TYPE (decl)) + && CLASSTYPE_TI_TEMPLATE (TREE_TYPE (decl))) + tmpl = CLASSTYPE_TI_TEMPLATE (TREE_TYPE (decl)); + else + { + cp_error ("`%D' does not declare a template type", decl); + return decl; + } + } else if (! DECL_TEMPLATE_INFO (decl)) { cp_error ("template definition of non-template `%#D'", decl); |