aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index eaa930f..e9add9a 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -468,7 +468,7 @@ forward_parm (tree parm)
tree type = TREE_TYPE (parm);
if (DECL_PACK_P (parm))
type = PACK_EXPANSION_PATTERN (type);
- if (TREE_CODE (type) != REFERENCE_TYPE)
+ if (!TYPE_REF_P (type))
type = cp_build_reference_type (type, /*rval=*/true);
warning_sentinel w (warn_useless_cast);
exp = build_static_cast (type, exp, tf_warning_or_error);
@@ -731,7 +731,7 @@ do_build_copy_constructor (tree fndecl)
the field is "T", then the type will usually be "const
T". (There are no cv-qualified variants of reference
types.) */
- if (TREE_CODE (expr_type) != REFERENCE_TYPE)
+ if (!TYPE_REF_P (expr_type))
{
int quals = cvquals;
@@ -742,7 +742,7 @@ do_build_copy_constructor (tree fndecl)
}
init = build3 (COMPONENT_REF, expr_type, parm, field, NULL_TREE);
- if (move_p && TREE_CODE (expr_type) != REFERENCE_TYPE
+ if (move_p && !TYPE_REF_P (expr_type)
/* 'move' breaks bit-fields, and has no effect for scalars. */
&& !scalarish_type_p (expr_type))
init = move (init);
@@ -829,7 +829,7 @@ do_build_copy_assign (tree fndecl)
"assignment operator", field);
continue;
}
- else if (TREE_CODE (expr_type) == REFERENCE_TYPE)
+ else if (TYPE_REF_P (expr_type))
{
error ("non-static reference member %q#D, can%'t use "
"default assignment operator", field);
@@ -858,7 +858,7 @@ do_build_copy_assign (tree fndecl)
expr_type = cp_build_qualified_type (expr_type, quals);
init = build3 (COMPONENT_REF, expr_type, init, field, NULL_TREE);
- if (move_p && TREE_CODE (expr_type) != REFERENCE_TYPE
+ if (move_p && !TYPE_REF_P (expr_type)
/* 'move' breaks bit-fields, and has no effect for scalars. */
&& !scalarish_type_p (expr_type))
init = move (init);
@@ -970,7 +970,7 @@ build_stub_type (tree type, int quals, bool rvalue)
static tree
build_stub_object (tree reftype)
{
- if (TREE_CODE (reftype) != REFERENCE_TYPE)
+ if (!TYPE_REF_P (reftype))
reftype = cp_build_reference_type (reftype, /*rval*/true);
tree stub = build1 (CONVERT_EXPR, reftype, integer_one_node);
return convert_from_reference (stub);
@@ -1149,7 +1149,7 @@ constructible_expr (tree to, tree from)
tree ctype = to;
vec<tree, va_gc> *args = NULL;
cp_unevaluated cp_uneval_guard;
- if (TREE_CODE (to) != REFERENCE_TYPE)
+ if (!TYPE_REF_P (to))
to = cp_build_reference_type (to, /*rval*/false);
tree ob = build_stub_object (to);
for (; from; from = TREE_CHAIN (from))
@@ -1324,7 +1324,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
error ("non-static const member %q#D, can%'t use default "
"assignment operator", field);
}
- else if (TREE_CODE (mem_type) == REFERENCE_TYPE)
+ else if (TYPE_REF_P (mem_type))
{
if (diag)
error ("non-static reference member %q#D, can%'t use "
@@ -1372,7 +1372,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
}
bad = true;
}
- else if (TREE_CODE (mem_type) == REFERENCE_TYPE)
+ else if (TYPE_REF_P (mem_type))
{
if (diag)
{
@@ -1403,7 +1403,7 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk,
else if (sfk == sfk_copy_constructor)
{
/* 12.8p11b5 */
- if (TREE_CODE (mem_type) == REFERENCE_TYPE
+ if (TYPE_REF_P (mem_type)
&& TYPE_REF_IS_RVALUE (mem_type))
{
if (diag)