tree
push_template_decl (tree decl, bool is_friend)
{
- tree tmpl;
- tree args;
- tree info;
- tree ctx;
- bool is_primary;
- bool is_partial;
int new_template_p = 0;
/* True if the template is a member template, in the sense of
[temp.mem]. */
return error_mark_node;
/* See if this is a partial specialization. */
- is_partial = ((DECL_IMPLICIT_TYPEDEF_P (decl)
- && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE
- && CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
- || (VAR_P (decl)
- && DECL_LANG_SPECIFIC (decl)
- && DECL_TEMPLATE_SPECIALIZATION (decl)
- && TINFO_USED_TEMPLATE_ID (DECL_TEMPLATE_INFO (decl))));
+ bool is_partial = ((DECL_IMPLICIT_TYPEDEF_P (decl)
+ && TREE_CODE (TREE_TYPE (decl)) != ENUMERAL_TYPE
+ && CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
+ || (VAR_P (decl)
+ && DECL_LANG_SPECIFIC (decl)
+ && DECL_TEMPLATE_SPECIALIZATION (decl)
+ && TINFO_USED_TEMPLATE_ID (DECL_TEMPLATE_INFO (decl))));
/* No surprising friend functions. */
gcc_checking_assert (is_friend
|| !(TREE_CODE (decl) == FUNCTION_DECL
&& DECL_UNIQUE_FRIEND_P (decl)));
+ tree ctx;
if (is_friend)
/* For a friend, we want the context of the friend, not
the type of which it is a friend. */
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
/* See if this is a primary template. */
+ bool is_primary = false;
if (is_friend && ctx
&& uses_template_parms_level (ctx, processing_template_decl))
/* A friend template that specifies a class context, i.e.
template <typename T> friend void A<T>::f();
is not primary. */
- is_primary = false;
+ ;
else if (TREE_CODE (decl) == TYPE_DECL && LAMBDA_TYPE_P (TREE_TYPE (decl)))
- is_primary = false;
+ /* Lambdas are not primary. */
+ ;
else
is_primary = template_parm_scope_p ();
if (is_partial)
return process_partial_specialization (decl);
- args = current_template_args ();
+ tree args = current_template_args ();
+ tree tmpl;
if (!ctx
|| TREE_CODE (ctx) == FUNCTION_DECL
|| (CLASS_TYPE_P (ctx) && TYPE_BEING_DEFINED (ctx))
if (DECL_TEMPLATE_INFO (tmpl))
args = add_outermost_template_args (DECL_TI_ARGS (tmpl), args);
- info = build_template_info (tmpl, args);
+ tree info = build_template_info (tmpl, args);
if (DECL_IMPLICIT_TYPEDEF_P (decl))
SET_TYPE_TEMPLATE_INFO (TREE_TYPE (tmpl), info);