From: Nathan Sidwell Date: Tue, 5 Sep 2017 20:02:04 +0000 (+0000) Subject: cp-tree.h (lang_decl_base): Rename template_conv_p to unknown_bound_p. X-Git-Tag: upstream/12.2.0~37247 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40300fa4545d51bb636d4f3ca4be6d6914cee321;p=platform%2Fupstream%2Fgcc.git cp-tree.h (lang_decl_base): Rename template_conv_p to unknown_bound_p. * cp-tree.h (lang_decl_base): Rename template_conv_p to unknown_bound_p. (DECL_CONV_FN_P): Don't check NULL DECL_NAME. (DECL_CONV_FN_TYPE): FN must be conv op. (DECL_TEMPLATE_CONV_FN_P): Delete. (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust. * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P From-SVN: r251734 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e0743ae..6d31718 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,14 @@ 2017-09-05 Nathan Sidwell + * cp-tree.h (lang_decl_base): Rename template_conv_p to + unknown_bound_p. + (DECL_CONV_FN_P): Don't check NULL DECL_NAME. + (DECL_CONV_FN_TYPE): FN must be conv op. + (DECL_TEMPLATE_CONV_FN_P): Delete. + (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): Adjust. + * pt.c (push_template_decl_real): Delete DECL_TEMPLATE_CONV_FN_P + setting. + * class.c (unreverse_member_declarations): Remove extraneous if. * pt.c (push_template_decl_real): Use string concatenation, not \. Add %<..%>. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 7dc20b1..9d24331 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2451,7 +2451,7 @@ struct GTY(()) lang_decl_base { unsigned anticipated_p : 1; /* fn, type or template */ /* anticipated_p reused as DECL_OMP_PRIVATIZED_MEMBER in var */ unsigned friend_or_tls : 1; /* var, fn, type or template */ - unsigned template_conv_p : 1; /* var or template */ + unsigned unknown_bound_p : 1; /* var */ unsigned odr_used : 1; /* var or fn */ unsigned u2sel : 1; unsigned concept_p : 1; /* applies to vars and functions */ @@ -2807,28 +2807,20 @@ struct GTY(()) lang_decl { || DECL_BASE_DESTRUCTOR_P (NODE))) /* Nonzero if NODE is a user-defined conversion operator. */ -#define DECL_CONV_FN_P(NODE) \ - (DECL_NAME (NODE) && IDENTIFIER_CONV_OP_P (DECL_NAME (NODE))) +#define DECL_CONV_FN_P(NODE) IDENTIFIER_CONV_OP_P (DECL_NAME (NODE)) -/* If FN is a conversion operator, the type to which it converts. - Otherwise, NULL_TREE. */ +/* The type to which conversion operator FN converts to. */ #define DECL_CONV_FN_TYPE(FN) \ - (DECL_CONV_FN_P (FN) ? TREE_TYPE (DECL_NAME (FN)) : NULL_TREE) - -/* Nonzero if NODE, which is a TEMPLATE_DECL, is a template - conversion operator to a type dependent on the innermost template - args. */ -#define DECL_TEMPLATE_CONV_FN_P(NODE) \ - (DECL_LANG_SPECIFIC (TEMPLATE_DECL_CHECK (NODE))->u.base.template_conv_p) + TREE_TYPE ((gcc_checking_assert (DECL_CONV_FN_P (FN)), DECL_NAME (FN))) /* Nonzero if NODE, a static data member, was declared in its class as an array of unknown bound. */ #define VAR_HAD_UNKNOWN_BOUND(NODE) \ (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE)) \ - ? DECL_LANG_SPECIFIC (NODE)->u.base.template_conv_p \ + ? DECL_LANG_SPECIFIC (NODE)->u.base.unknown_bound_p \ : false) #define SET_VAR_HAD_UNKNOWN_BOUND(NODE) \ - (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.template_conv_p = true) + (DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE))->u.base.unknown_bound_p = true) /* Set the overloaded operator code for NODE to CODE. */ #define SET_OVERLOADED_OPERATOR_CODE(NODE, CODE) \ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index aeb523d..f422e9c 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5608,25 +5608,13 @@ push_template_decl_real (tree decl, bool is_friend) if (is_primary) { tree parms = DECL_TEMPLATE_PARMS (tmpl); - int i; DECL_PRIMARY_TEMPLATE (tmpl) = tmpl; - if (DECL_CONV_FN_P (tmpl)) - { - int depth = TMPL_PARMS_DEPTH (parms); - - /* It is a conversion operator. See if the type converted to - depends on innermost template operands. */ - - if (uses_template_parms_level (TREE_TYPE (TREE_TYPE (tmpl)), - depth)) - DECL_TEMPLATE_CONV_FN_P (tmpl) = 1; - } /* Give template template parms a DECL_CONTEXT of the template for which they are a parameter. */ parms = INNERMOST_TEMPLATE_PARMS (parms); - for (i = TREE_VEC_LENGTH (parms) - 1; i >= 0; --i) + for (int i = TREE_VEC_LENGTH (parms) - 1; i >= 0; --i) { tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i)); if (TREE_CODE (parm) == TEMPLATE_DECL)