From ae34ce041ae8f21a8dddf1f7eeac26edc745768b Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 2 Apr 2013 14:04:53 +0000 Subject: friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P. 2013-04-02 Paolo Carlini * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P. * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS. (for_each_template_parm_r): Use TYPE_TI_ARGS. From-SVN: r197356 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/friend.c | 3 +-- gcc/cp/pt.c | 9 +++------ 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7c9ba74..7b73e03 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2013-04-02 Paolo Carlini + * friend.c (do_friend): Use COMPLETE_OR_OPEN_TYPE_P. + * pt.c (find_parameter_packs_r): Use TYPE_ALIAS_P and TYPE_TI_ARGS. + (for_each_template_parm_r): Use TYPE_TI_ARGS. + +2013-04-02 Paolo Carlini + * cp-tree.h (TAGGED_TYPE_P): Remove. (IS_OVERLOAD_TYPE): Rename to OVERLOAD_TYPE_P, adjust. (TYPE_ANONYMOUS_P): Adjust. diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 0833728..3c63ea6 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -485,8 +485,7 @@ do_friend (tree ctype, tree declarator, tree decl, to be a friend, so we do lookup here even if CTYPE is in the process of being defined. */ if (class_template_depth - || COMPLETE_TYPE_P (ctype) - || (CLASS_TYPE_P (ctype) && TYPE_BEING_DEFINED (ctype))) + || COMPLETE_OR_OPEN_TYPE_P (ctype)) { if (DECL_TEMPLATE_INFO (decl)) /* DECL is a template specialization. No need to diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 8671bd9..1d429fe 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3058,10 +3058,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) bool parameter_pack_p = false; /* Handle type aliases/typedefs. */ - if (TYPE_P (t) - && TYPE_NAME (t) - && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL - && TYPE_DECL_ALIAS_P (TYPE_NAME (t))) + if (TYPE_ALIAS_P (t)) { if (TYPE_TEMPLATE_INFO (t)) cp_walk_tree (&TYPE_TI_ARGS (t), @@ -3146,7 +3143,7 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) case UNION_TYPE: case ENUMERAL_TYPE: if (TYPE_TEMPLATE_INFO (t)) - cp_walk_tree (&TI_ARGS (TYPE_TEMPLATE_INFO (t)), + cp_walk_tree (&TYPE_TI_ARGS (t), &find_parameter_packs_r, ppd, ppd->visited); *walk_subtrees = 0; @@ -7619,7 +7616,7 @@ for_each_template_parm_r (tree *tp, int *walk_subtrees, void *d) case ENUMERAL_TYPE: if (!TYPE_TEMPLATE_INFO (t)) *walk_subtrees = 0; - else if (for_each_template_parm (TI_ARGS (TYPE_TEMPLATE_INFO (t)), + else if (for_each_template_parm (TYPE_TI_ARGS (t), fn, data, pfd->visited, pfd->include_nondeduced_p)) return error_mark_node; -- cgit v1.1