aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r--gcc/cp/constexpr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index d9a4cab..9ee37de 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -60,7 +60,7 @@ literal_type_p (tree t)
{
if (SCALAR_TYPE_P (t)
|| VECTOR_TYPE_P (t)
- || TREE_CODE (t) == REFERENCE_TYPE
+ || TYPE_REF_P (t)
|| (VOID_TYPE_P (t) && cxx_dialect >= cxx14))
return true;
if (CLASS_TYPE_P (t))
@@ -1328,7 +1328,7 @@ cxx_bind_parameters_in_call (const constexpr_ctx *ctx, tree t,
arg = unshare_constructor (arg);
/* Make sure the binding has the same type as the parm. But
only for constant args. */
- if (TREE_CODE (type) != REFERENCE_TYPE)
+ if (!TYPE_REF_P (type))
arg = adjust_temp_type (type, arg);
if (!TREE_CONSTANT (arg))
*non_constant_args = true;
@@ -3394,7 +3394,7 @@ non_const_var_error (tree r)
else
gcc_unreachable ();
}
- else if (TREE_CODE (type) == REFERENCE_TYPE)
+ else if (TYPE_REF_P (type))
inform (DECL_SOURCE_LOCATION (r),
"%qD was not initialized with a constant "
"expression", r);
@@ -4104,7 +4104,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
}
if (TREE_CODE (t) == INTEGER_CST
- && TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE
+ && TYPE_PTR_P (TREE_TYPE (t))
&& !integer_zerop (t))
{
if (!ctx->quiet)
@@ -4185,13 +4185,13 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
return t;
case PARM_DECL:
- if (lval && TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE)
+ if (lval && !TYPE_REF_P (TREE_TYPE (t)))
/* glvalue use. */;
else if (tree *p = ctx->values->get (r))
r = *p;
else if (lval)
/* Defer in case this is only used for its type. */;
- else if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE)
+ else if (TYPE_REF_P (TREE_TYPE (t)))
/* Defer, there's no lvalue->rvalue conversion. */;
else if (COMPLETE_TYPE_P (TREE_TYPE (t))
&& is_really_empty_class (TREE_TYPE (t)))
@@ -4619,7 +4619,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
{
if (integer_zerop (op))
{
- if (TREE_CODE (type) == REFERENCE_TYPE)
+ if (TYPE_REF_P (type))
{
if (!ctx->quiet)
error_at (EXPR_LOC_OR_LOC (t, input_location),
@@ -4627,7 +4627,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
*non_constant_p = true;
return t;
}
- else if (TREE_CODE (TREE_TYPE (op)) == POINTER_TYPE)
+ else if (TYPE_PTR_P (TREE_TYPE (op)))
{
tree from = TREE_TYPE (op);
@@ -5807,7 +5807,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
}
return (RECUR (TREE_OPERAND (t, 0),
- TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE));
+ !TYPE_REF_P (TREE_TYPE (t))));
case BIND_EXPR:
return RECUR (BIND_EXPR_BODY (t), want_rval);