Now I know about VAR_OR_FUNCTION_DECL_P I found a place to use it.
Also positively checking for a function_decl is clearer than
negatively checking for things that are not.
gcc/cp/
* pt.c (primary_template_specialization_p): Use
VAR_OR_FUNCTION_DECL_P.
(tsubst_template_decl): Check for FUNCTION_DECL, not !TYPE && !VAR
for registering a specialization.
if (!t)
return false;
- if (TREE_CODE (t) == FUNCTION_DECL || VAR_P (t))
+ if (VAR_OR_FUNCTION_DECL_P (t))
return (DECL_LANG_SPECIFIC (t)
&& DECL_USE_TEMPLATE (t)
&& DECL_TEMPLATE_INFO (t)
if (PRIMARY_TEMPLATE_P (t))
DECL_PRIMARY_TEMPLATE (r) = r;
- if (TREE_CODE (decl) != TYPE_DECL && !VAR_P (decl)
- && !lambda_fntype)
+ if (TREE_CODE (decl) == FUNCTION_DECL && !lambda_fntype)
/* Record this non-type partial instantiation. */
register_specialization (r, t,
DECL_TI_ARGS (DECL_TEMPLATE_RESULT (r)),