+2016-10-24 Jakub Jelinek <jakub@redhat.com>
+
+ * cxx-pretty-print.c (pp_cxx_check_constraint): Use VAR_P (x)
+ instead of TREE_CODE (x) == VAR_DECL.
+ * constraint.cc (get_concept_definition): Likewise.
+ (finish_shorthand_constraint): Likewise.
+ * init.c (warn_placement_new_too_small): Likewise.
+ * cp-gimplify.c (cp_genericize_r): Likewise.
+
2016-10-21 Jason Merrill <jason@redhat.com>
PR c++/77656
tree
get_concept_definition (tree decl)
{
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
return get_variable_initializer (decl);
else if (TREE_CODE (decl) == FUNCTION_DECL)
return get_returned_expression (decl);
the constraint an expansion. */
tree check;
tree tmpl = DECL_TI_TEMPLATE (con);
- if (TREE_CODE (con) == VAR_DECL)
- {
- check = build_concept_check (tmpl, arg, args);
- }
+ if (VAR_P (con))
+ check = build_concept_check (tmpl, arg, args);
else
{
tree ovl = build_overload (tmpl, NULL_TREE);
else if (TREE_CODE (stmt) == DECL_EXPR)
{
tree d = DECL_EXPR_DECL (stmt);
- if (TREE_CODE (d) == VAR_DECL)
+ if (VAR_P (d))
gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
}
else if (TREE_CODE (stmt) == OMP_PARALLEL
tree args = CHECK_CONSTR_ARGS (t);
tree id = build_nt (TEMPLATE_ID_EXPR, tmpl, args);
- if (TREE_CODE (decl) == VAR_DECL)
+ if (VAR_P (decl))
pp->expression (id);
else if (TREE_CODE (decl) == FUNCTION_DECL)
{
to placement new is not checked since it's unknown what it might
point to. */
if (TREE_CODE (oper) == PARM_DECL
- || TREE_CODE (oper) == VAR_DECL
+ || VAR_P (oper)
|| TREE_CODE (oper) == COMPONENT_REF)
return;
{
tree op0 = oper;
while (TREE_CODE (op0 = TREE_OPERAND (op0, 0)) == COMPONENT_REF);
- if (TREE_CODE (op0) == VAR_DECL)
+ if (VAR_P (op0))
var_decl = op0;
oper = TREE_OPERAND (oper, 1);
}
if ((addr_expr || !POINTER_TYPE_P (TREE_TYPE (oper)))
- && (TREE_CODE (oper) == VAR_DECL
+ && (VAR_P (oper)
|| TREE_CODE (oper) == FIELD_DECL
|| TREE_CODE (oper) == PARM_DECL))
{
/* Treat members of unions and members of structs uniformly, even
though the size of a member of a union may be viewed as extending
to the end of the union itself (it is by __builtin_object_size). */
- if ((TREE_CODE (oper) == VAR_DECL || use_obj_size)
+ if ((VAR_P (oper) || use_obj_size)
&& DECL_SIZE_UNIT (oper)
&& tree_fits_uhwi_p (DECL_SIZE_UNIT (oper)))
{