mirror of git://gcc.gnu.org/git/gcc.git
[C++ PATCH] some cleanups
https://gcc.gnu.org/ml/gcc-patches/2018-04/msg01227.html * cp-tree.h (TEMPLATE_INFO): Fix comments. (TI_PENDING_TEMPLATE_FLAG): Check TEMPLATE_INFO. (NON_DEFAULT_TEMPLATE_ARG_COUNT): Wrap line. (dump, print_other_binding_stacks): Remove declarations. * name-lookup.c (print_other_binding_stack): Make static. * pt.c (build_template_decl): Make static. From-SVN: r259704
This commit is contained in:
parent
ae0432915e
commit
d4e15523c1
|
|
@ -1,3 +1,12 @@
|
||||||
|
2018-04-27 Nathan Sidwell <nathan@acm.org>
|
||||||
|
|
||||||
|
* cp-tree.h (TEMPLATE_INFO): Fix comments.
|
||||||
|
(TI_PENDING_TEMPLATE_FLAG): Check TEMPLATE_INFO.
|
||||||
|
(NON_DEFAULT_TEMPLATE_ARG_COUNT): Wrap line.
|
||||||
|
(dump, print_other_binding_stacks): Remove declarations.
|
||||||
|
* name-lookup.c (print_other_binding_stack): Make static.
|
||||||
|
* pt.c (build_template_decl): Make static.
|
||||||
|
|
||||||
2018-04-26 Jason Merrill <jason@redhat.com>
|
2018-04-26 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
PR c++/85545 - ICE with noexcept PMF conversion.
|
PR c++/85545 - ICE with noexcept PMF conversion.
|
||||||
|
|
|
||||||
|
|
@ -3273,11 +3273,11 @@ extern void decl_shadowed_for_var_insert (tree, tree);
|
||||||
DECL_USE_TEMPLATE is nonzero) or the abstract instance of the
|
DECL_USE_TEMPLATE is nonzero) or the abstract instance of the
|
||||||
template itself.
|
template itself.
|
||||||
|
|
||||||
In either case, DECL_TEMPLATE_INFO is a TREE_LIST, whose
|
In either case, DECL_TEMPLATE_INFO is a TEMPLATE_INFO, whose
|
||||||
TREE_PURPOSE is the TEMPLATE_DECL of which this entity is a
|
TI_TEMPLATE is the TEMPLATE_DECL of which this entity is a
|
||||||
specialization or abstract instance. The TREE_VALUE is the
|
specialization or abstract instance. The TI_ARGS is the
|
||||||
template arguments used to specialize the template.
|
template arguments used to specialize the template.
|
||||||
|
|
||||||
Consider:
|
Consider:
|
||||||
|
|
||||||
template <typename T> struct S { friend void f(T) {} };
|
template <typename T> struct S { friend void f(T) {} };
|
||||||
|
|
@ -3344,11 +3344,14 @@ extern void decl_shadowed_for_var_insert (tree, tree);
|
||||||
|
|
||||||
#define TI_TEMPLATE(NODE) TREE_TYPE (TEMPLATE_INFO_CHECK (NODE))
|
#define TI_TEMPLATE(NODE) TREE_TYPE (TEMPLATE_INFO_CHECK (NODE))
|
||||||
#define TI_ARGS(NODE) TREE_CHAIN (TEMPLATE_INFO_CHECK (NODE))
|
#define TI_ARGS(NODE) TREE_CHAIN (TEMPLATE_INFO_CHECK (NODE))
|
||||||
#define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
|
#define TI_PENDING_TEMPLATE_FLAG(NODE) \
|
||||||
|
TREE_LANG_FLAG_1 (TEMPLATE_INFO_CHECK (NODE))
|
||||||
/* For a given TREE_VEC containing a template argument list,
|
/* For a given TREE_VEC containing a template argument list,
|
||||||
this property contains the number of arguments that are not
|
this property contains the number of arguments that are not
|
||||||
defaulted. */
|
defaulted. */
|
||||||
#define NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) TREE_CHAIN (TREE_VEC_CHECK (NODE))
|
#define NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) \
|
||||||
|
TREE_CHAIN (TREE_VEC_CHECK (NODE))
|
||||||
|
|
||||||
/* Below are the setter and getter of the NON_DEFAULT_TEMPLATE_ARGS_COUNT
|
/* Below are the setter and getter of the NON_DEFAULT_TEMPLATE_ARGS_COUNT
|
||||||
property. */
|
property. */
|
||||||
#define SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE, INT_VALUE) \
|
#define SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE, INT_VALUE) \
|
||||||
|
|
@ -6229,9 +6232,6 @@ extern tree strip_fnptr_conv (tree);
|
||||||
extern void maybe_push_cleanup_level (tree);
|
extern void maybe_push_cleanup_level (tree);
|
||||||
extern tree make_anon_name (void);
|
extern tree make_anon_name (void);
|
||||||
extern tree check_for_out_of_scope_variable (tree);
|
extern tree check_for_out_of_scope_variable (tree);
|
||||||
extern void dump (cp_binding_level &ref);
|
|
||||||
extern void dump (cp_binding_level *ptr);
|
|
||||||
extern void print_other_binding_stack (cp_binding_level *);
|
|
||||||
extern tree maybe_push_decl (tree);
|
extern tree maybe_push_decl (tree);
|
||||||
extern tree current_decl_namespace (void);
|
extern tree current_decl_namespace (void);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3742,7 +3742,7 @@ debug (cp_binding_level *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
static void
|
||||||
print_other_binding_stack (cp_binding_level *stack)
|
print_other_binding_stack (cp_binding_level *stack)
|
||||||
{
|
{
|
||||||
cp_binding_level *level;
|
cp_binding_level *level;
|
||||||
|
|
|
||||||
|
|
@ -4674,7 +4674,7 @@ maybe_update_decl_type (tree orig_type, tree scope)
|
||||||
template PARMS and constraints, CONSTR. If MEMBER_TEMPLATE_P is true,
|
template PARMS and constraints, CONSTR. If MEMBER_TEMPLATE_P is true,
|
||||||
the new template is a member template. */
|
the new template is a member template. */
|
||||||
|
|
||||||
tree
|
static tree
|
||||||
build_template_decl (tree decl, tree parms, bool member_template_p)
|
build_template_decl (tree decl, tree parms, bool member_template_p)
|
||||||
{
|
{
|
||||||
tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);
|
tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue