diff options
author | Mark Mitchell <mmitchell@usa.net> | 1998-04-21 22:03:34 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-04-21 22:03:34 +0000 |
commit | 1701f21e5231f328d532adb1709caf5fe7ae2717 (patch) | |
tree | 2bf7550ae37ff055ead2a822a86d20fcc8c2f691 /gcc | |
parent | fb1653e1f8e1cc935ea9f84112a3933362a53bdf (diff) | |
download | gcc-1701f21e5231f328d532adb1709caf5fe7ae2717.zip gcc-1701f21e5231f328d532adb1709caf5fe7ae2717.tar.gz gcc-1701f21e5231f328d532adb1709caf5fe7ae2717.tar.bz2 |
decl2.c (check_member_template): Set DECL_IGNORED for member class templates, too.
* decl2.c (check_member_template): Set DECL_IGNORED for member
class templates, too.
From-SVN: r19368
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 16 |
2 files changed, 7 insertions, 12 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dc23099..cffacb0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -2,6 +2,9 @@ Tue Apr 21 22:00:04 1998 Mark Mitchell <mmitchell@usa.net> * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory. + * decl2.c (check_member_template): Set DECL_IGNORED for member + class templates, too. + Tue Apr 21 18:59:11 1998 Benjamin Kosnik <bkoz@rhino.cygnus.com> * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 8f0c954..6b24edc 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1343,7 +1343,9 @@ check_member_template (tmpl) my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0); decl = DECL_TEMPLATE_RESULT (tmpl); - if (TREE_CODE (decl) == FUNCTION_DECL) + if (TREE_CODE (decl) == FUNCTION_DECL + || (TREE_CODE (decl) == TYPE_DECL + && IS_AGGR_TYPE (TREE_TYPE (decl)))) { if (current_function_decl) /* 14.5.2.2 [temp.mem] @@ -1352,7 +1354,7 @@ check_member_template (tmpl) cp_error ("declaration of of member template `%#D' in local class", decl); - if (DECL_VIRTUAL_P (decl)) + if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl)) { /* 14.5.2.3 [temp.mem] @@ -1367,16 +1369,6 @@ check_member_template (tmpl) with member templates. */ DECL_IGNORED_P (tmpl) = 1; } - else if (TREE_CODE (decl) == TYPE_DECL - && IS_AGGR_TYPE (TREE_TYPE (decl))) - { - if (current_function_decl) - /* 14.5.2.2 [temp.mem] - - A local class shall not have member templates. */ - cp_error ("declaration of of member template `%#D' in local class", - decl); - } else cp_error ("template declaration of `%#D'", decl); } |