diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-08-17 12:26:39 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-08-17 12:26:39 +0000 |
commit | 4b054b8004c01fbdc368f1adfbc35681ec63f435 (patch) | |
tree | dc83201e24e209489973c8e23767f94b2ee9b3ac /gcc/cp/pt.c | |
parent | 07745bdb36b003562aadda9564917e0413c7b403 (diff) | |
download | gcc-4b054b8004c01fbdc368f1adfbc35681ec63f435.zip gcc-4b054b8004c01fbdc368f1adfbc35681ec63f435.tar.gz gcc-4b054b8004c01fbdc368f1adfbc35681ec63f435.tar.bz2 |
cp-tree.h (CPTR_AGGR_TAG): New global tree node.
* cp-tree.h (CPTR_AGGR_TAG): New global tree node.
(current_aggr): Define.
* decl.c (grokdeclarator): Make sure a friend class is an
elaborated type specifier.
* parse.y (current_aggr): Remove static definition.
(cp_parse_init): Adjust.
(structsp): Clear and restore current_aggr.
(component_decl_list): Clear current_aggr.
* error.c (dump_type, case TYPENAME_TYPE): Don't emit the
aggregate tag on the typename's context.
* pt.c (tsubst_friend_class): Return NULL, if parms becomes NULL.
(instantiate_class_template): Ignore NULL friend types.
From-SVN: r35755
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 3d0a1b3..302d962 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4677,7 +4677,8 @@ tsubst_friend_function (decl, args) /* FRIEND_TMPL is a friend TEMPLATE_DECL. ARGS is the vector of template arguments, as for tsubst. - Returns an appropriate tsbust'd friend type. */ + Returns an appropriate tsbust'd friend type or error_mark_node on + failure. */ static tree tsubst_friend_class (friend_tmpl, args) @@ -4718,6 +4719,8 @@ tsubst_friend_class (friend_tmpl, args) tree parms = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_tmpl), args, /*complain=*/1); + if (!parms) + return error_mark_node; redeclare_class_template (TREE_TYPE (tmpl), parms); friend_type = TREE_TYPE (tmpl); } @@ -5144,7 +5147,8 @@ instantiate_class_template (type) information. */ ++processing_template_decl; - make_friend_class (type, new_friend_type); + if (new_friend_type != error_mark_node) + make_friend_class (type, new_friend_type); if (TREE_CODE (friend_type) == TEMPLATE_DECL) --processing_template_decl; |