Commit 40300fa4 by Nathan Sidwell Committed by Nathan Sidwell

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
parent 6657c1f9
2017-09-05 Nathan Sidwell <nathan@acm.org>
* 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
\<newline>. Add %<..%>.
......
......@@ -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) \
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment