+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>
PR c++/85545 - ICE with noexcept PMF conversion.
DECL_USE_TEMPLATE is nonzero) or the abstract instance of the
template itself.
- In either case, DECL_TEMPLATE_INFO is a TREE_LIST, whose
- TREE_PURPOSE is the TEMPLATE_DECL of which this entity is a
- specialization or abstract instance. The TREE_VALUE is the
+ In either case, DECL_TEMPLATE_INFO is a TEMPLATE_INFO, whose
+ TI_TEMPLATE is the TEMPLATE_DECL of which this entity is a
+ specialization or abstract instance. The TI_ARGS is the
template arguments used to specialize the template.
-
+
Consider:
template <typename T> struct S { friend void f(T) {} };
#define TI_TEMPLATE(NODE) TREE_TYPE (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,
this property contains the number of arguments that are not
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
property. */
#define SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE, INT_VALUE) \
extern void maybe_push_cleanup_level (tree);
extern tree make_anon_name (void);
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 current_decl_namespace (void);
template PARMS and constraints, CONSTR. If MEMBER_TEMPLATE_P is true,
the new template is a member template. */
-tree
+static tree
build_template_decl (tree decl, tree parms, bool member_template_p)
{
tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);