@@ -4549,7 +4549,7 @@ conditional_conversion (tree e1, tree e2, tsubst_flags_t complain)
If E2 is an xvalue: E1 can be converted to match E2 if E1 can be
implicitly converted to the type "rvalue reference to T2", subject to
the constraint that the reference must bind directly. */
- if (lvalue_or_rvalue_with_address_p (e2))
+ if (glvalue_p (e2))
{
tree rtype = cp_build_reference_type (t2, !real_lvalue_p (e2));
conv = implicit_conversion (rtype,
@@ -4882,8 +4882,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
&& (CLASS_TYPE_P (arg2_type) || CLASS_TYPE_P (arg3_type)
|| (same_type_ignoring_top_level_qualifiers_p (arg2_type,
arg3_type)
- && lvalue_or_rvalue_with_address_p (arg2)
- && lvalue_or_rvalue_with_address_p (arg3)
+ && glvalue_p (arg2) && glvalue_p (arg3)
&& real_lvalue_p (arg2) == real_lvalue_p (arg3))))
{
conversion *conv2;
@@ -6515,7 +6515,7 @@ extern tree copy_binfo (tree, tree, tree,
extern int member_p (const_tree);
extern cp_lvalue_kind real_lvalue_p (const_tree);
extern cp_lvalue_kind lvalue_kind (const_tree);
-extern bool lvalue_or_rvalue_with_address_p (const_tree);
+extern bool glvalue_p (const_tree);
extern bool xvalue_p (const_tree);
extern tree cp_stabilize_reference (tree);
extern bool builtin_valid_in_constant_expr_p (const_tree);
@@ -266,20 +266,10 @@ real_lvalue_p (const_tree ref)
return kind;
}
-/* This differs from real_lvalue_p in that class rvalues are considered
- lvalues. */
+/* This differs from real_lvalue_p in that xvalues are included. */
bool
-lvalue_p (const_tree ref)
-{
- return (lvalue_kind (ref) != clk_none);
-}
-
-/* This differs from real_lvalue_p in that rvalues formed by dereferencing
- rvalue references are considered rvalues. */
-
-bool
-lvalue_or_rvalue_with_address_p (const_tree ref)
+glvalue_p (const_tree ref)
{
cp_lvalue_kind kind = lvalue_kind (ref);
if (kind & clk_class)
@@ -288,7 +278,16 @@ lvalue_or_rvalue_with_address_p (const_tree ref)
return (kind != clk_none);
}
-/* Returns true if REF is an xvalue, false otherwise. */
+/* This differs from glvalue_p in that class prvalues are included. */
+
+bool
+lvalue_p (const_tree ref)
+{
+ return (lvalue_kind (ref) != clk_none);
+}
+
+/* Returns true if REF is an xvalue (the result of dereferencing an rvalue
+ reference), false otherwise. */
bool
xvalue_p (const_tree ref)
@@ -781,7 +780,7 @@ rvalue (tree expr)
/* We need to do this for rvalue refs as well to get the right answer
from decltype; see c++/36628. */
- if (!processing_template_decl && lvalue_or_rvalue_with_address_p (expr))
+ if (!processing_template_decl && glvalue_p (expr))
expr = build1 (NON_LVALUE_EXPR, type, expr);
else if (type != TREE_TYPE (expr))
expr = build_nop (type, expr);
@@ -4260,7 +4259,7 @@ stabilize_expr (tree exp, tree* initp)
arguments with such a type; just treat it as a pointer. */
else if (TREE_CODE (TREE_TYPE (exp)) == REFERENCE_TYPE
|| SCALAR_TYPE_P (TREE_TYPE (exp))
- || !lvalue_or_rvalue_with_address_p (exp))
+ || !glvalue_p (exp))
{
init_expr = get_target_expr (exp);
exp = TARGET_EXPR_SLOT (init_expr);
@@ -4388,7 +4387,7 @@ stabilize_init (tree init, tree *initp)
&& TREE_CODE (t) != CONSTRUCTOR
&& TREE_CODE (t) != AGGR_INIT_EXPR
&& (SCALAR_TYPE_P (TREE_TYPE (t))
- || lvalue_or_rvalue_with_address_p (t)))
+ || glvalue_p (t)))
{
TREE_OPERAND (init, 1) = stabilize_expr (t, initp);
return true;
@@ -6302,8 +6302,7 @@ build_x_conditional_expr (location_t loc, tree ifexp, tree op1, tree op2,
tree min = build_min_non_dep (COND_EXPR, expr,
orig_ifexp, orig_op1, orig_op2);
/* Remember that the result is an lvalue or xvalue. */
- if (lvalue_or_rvalue_with_address_p (expr)
- && !lvalue_or_rvalue_with_address_p (min))
+ if (glvalue_p (expr) && !glvalue_p (min))
TREE_TYPE (min) = cp_build_reference_type (TREE_TYPE (min),
!real_lvalue_p (expr));
expr = convert_from_reference (min);
@@ -7243,7 +7242,7 @@ build_const_cast_1 (tree dst_type, tree expr, tsubst_flags_t complain,
? real_lvalue_p (expr)
: (CLASS_TYPE_P (TREE_TYPE (dst_type))
? lvalue_p (expr)
- : lvalue_or_rvalue_with_address_p (expr)))
+ : glvalue_p (expr)))
/* OK. */;
else
{
new file mode 100644
commit f4477417b14ee075b7ce37db49b3d92f87a5fcc5
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jul 7 16:45:40 2016 -0400
Rename lvalue_p to obvalue_p.
* tree.c (obvalue_p): Rename from lvalue_p.
(lvalue_p): Define for c-common.
* call.c, cp-tree.h, cvt.c, init.c: Adjust.
* typeck.c: Adjust.
(cp_build_addr_expr_1): Remove obsolete code.
@@ -1126,7 +1126,10 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
fcode = TREE_CODE (from);
conv = build_conv (ck_lvalue, from, conv);
}
- else if (fromref || (expr && lvalue_p (expr)))
+ /* Wrapping a ck_rvalue around a class prvalue (as a result of using
+ obvalue_p) seems odd, since it's already a prvalue, but that's how we
+ express the copy constructor call required by copy-initialization. */
+ else if (fromref || (expr && obvalue_p (expr)))
{
if (expr)
{
@@ -6516,6 +6516,11 @@ extern int member_p (const_tree);
extern cp_lvalue_kind real_lvalue_p (const_tree);
extern cp_lvalue_kind lvalue_kind (const_tree);
extern bool glvalue_p (const_tree);
+/* obvalue_p used to be named lvalue_p, but that didn't match the C++
+ definition of lvalue. For now, let's not use the name lvalue_p in the front
+ end; later we can rename real_lvalue_p to lvalue_p. */
+#define lvalue_p(T) syntax error, use real_lvalue_p
+extern bool obvalue_p (const_tree);
extern bool xvalue_p (const_tree);
extern tree cp_stabilize_reference (tree);
extern bool builtin_valid_in_constant_expr_p (const_tree);
@@ -330,7 +330,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl,
cp_finish_decl (arg, targ, /*init_const_expr_p=*/false, NULL_TREE,
LOOKUP_ONLYCONVERTING|DIRECT_BIND);
}
- else if (!(flags & DIRECT_BIND) && ! lvalue_p (arg))
+ else if (!(flags & DIRECT_BIND) && ! obvalue_p (arg))
return get_target_expr_sfinae (arg, complain);
/* If we had a way to wrap this up, and say, if we ever needed its
@@ -473,7 +473,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
return build_up_reference (reftype, expr, flags, decl, complain);
}
- else if ((convtype & CONV_REINTERPRET) && lvalue_p (expr))
+ else if ((convtype & CONV_REINTERPRET) && obvalue_p (expr))
{
/* When casting an lvalue to a reference type, just convert into
a pointer to the new type and deference it. This is allowed
@@ -3332,7 +3332,7 @@ build_new_1 (vec<tree, va_gc> **placement, tree type, tree nelts,
rval = build2 (COMPOUND_EXPR, TREE_TYPE (rval), init_preeval_expr, rval);
/* A new-expression is never an lvalue. */
- gcc_assert (!lvalue_p (rval));
+ gcc_assert (!obvalue_p (rval));
return convert (pointer_type, rval);
}
@@ -266,6 +266,14 @@ real_lvalue_p (const_tree ref)
return kind;
}
+/* Defined for c-common; the front end should use real_lvalue_p. */
+
+bool
+(lvalue_p) (const_tree t)
+{
+ return real_lvalue_p (t);
+}
+
/* This differs from real_lvalue_p in that xvalues are included. */
bool
@@ -281,7 +289,7 @@ glvalue_p (const_tree ref)
/* This differs from glvalue_p in that class prvalues are included. */
bool
-lvalue_p (const_tree ref)
+obvalue_p (const_tree ref)
{
return (lvalue_kind (ref) != clk_none);
}
@@ -1987,7 +1987,7 @@ decay_conversion (tree exp,
TREE_OPERAND (exp, 0), op1);
}
- if (!lvalue_p (exp)
+ if (!obvalue_p (exp)
&& ! (TREE_CODE (exp) == CONSTRUCTOR && TREE_STATIC (exp)))
{
if (complain & tf_error)
@@ -5678,16 +5678,8 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain)
CASE_CONVERT:
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
- /* Even if we're not being pedantic, we cannot allow this
- extension when we're instantiating in a SFINAE
- context. */
- if (! lvalue_p (arg) && complain == tf_none)
- {
- if (complain & tf_error)
- permerror (input_location, "ISO C++ forbids taking the address of a cast to a non-lvalue expression");
- else
- return error_mark_node;
- }
+ /* We should have handled this above in the lvalue_kind check. */
+ gcc_unreachable ();
break;
case BASELINK:
@@ -7240,9 +7232,7 @@ build_const_cast_1 (tree dst_type, tree expr, tsubst_flags_t complain,
reference_type = dst_type;
if (!TYPE_REF_IS_RVALUE (dst_type)
? real_lvalue_p (expr)
- : (CLASS_TYPE_P (TREE_TYPE (dst_type))
- ? lvalue_p (expr)
- : glvalue_p (expr)))
+ : obvalue_p (expr))
/* OK. */;
else
{
commit 9fd7f623f5ad6685071f1720b4ced3b45538291b
Author: Jason Merrill <jason@redhat.com>
Date: Fri Jul 8 15:53:34 2016 -0400
Use lvalue_p instead of real_lvalue_p.
* cp-tree.h: Unpoison lvalue_p.
* call.c, class.c, constexpr.c, cvt.c, init.c, lambda.c, pt.c,
tree.c, typeck.c, typeck2.c: Use lvalue_p instead of
real_lvalue_p.
@@ -2925,7 +2925,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
if (code == COND_EXPR)
{
- if (real_lvalue_p (args[i]))
+ if (lvalue_p (args[i]))
vec_safe_push (types[i], build_reference_type (argtypes[i]));
vec_safe_push (types[i], TYPE_MAIN_VARIANT (argtypes[i]));
@@ -2962,7 +2962,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
}
else
{
- if (code == COND_EXPR && real_lvalue_p (args[i]))
+ if (code == COND_EXPR && lvalue_p (args[i]))
vec_safe_push (types[i], build_reference_type (argtypes[i]));
type = non_reference (argtypes[i]);
if (i != 0 || ! ref1)
@@ -4554,7 +4554,7 @@ conditional_conversion (tree e1, tree e2, tsubst_flags_t complain)
the constraint that the reference must bind directly. */
if (glvalue_p (e2))
{
- tree rtype = cp_build_reference_type (t2, !real_lvalue_p (e2));
+ tree rtype = cp_build_reference_type (t2, !lvalue_p (e2));
conv = implicit_conversion (rtype,
t1,
e1,
@@ -4619,7 +4619,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
tree arg3_type;
tree result = NULL_TREE;
tree result_type = NULL_TREE;
- bool lvalue_p = true;
+ bool is_lvalue = true;
struct z_candidate *candidates = 0;
struct z_candidate *cand;
void *p;
@@ -4636,7 +4636,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
"ISO C++ forbids omitting the middle term of a ?: expression");
/* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */
- if (real_lvalue_p (arg1))
+ if (lvalue_p (arg1))
arg2 = arg1 = cp_stabilize_reference (arg1);
else
arg2 = arg1 = save_expr (arg1);
@@ -4871,7 +4871,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
return error_mark_node;
}
- lvalue_p = false;
+ is_lvalue = false;
goto valid_operands;
}
/* [expr.cond]
@@ -4886,7 +4886,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
|| (same_type_ignoring_top_level_qualifiers_p (arg2_type,
arg3_type)
&& glvalue_p (arg2) && glvalue_p (arg3)
- && real_lvalue_p (arg2) == real_lvalue_p (arg3))))
+ && lvalue_p (arg2) == lvalue_p (arg3))))
{
conversion *conv2;
conversion *conv3;
@@ -4984,7 +4984,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
If the second and third operands are glvalues of the same value
category and have the same type, the result is of that type and
value category. */
- if (((real_lvalue_p (arg2) && real_lvalue_p (arg3))
+ if (((lvalue_p (arg2) && lvalue_p (arg3))
|| (xvalue_p (arg2) && xvalue_p (arg3)))
&& same_type_p (arg2_type, arg3_type))
{
@@ -5001,7 +5001,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
cv-qualified) class type, overload resolution is used to
determine the conversions (if any) to be applied to the operands
(_over.match.oper_, _over.built_). */
- lvalue_p = false;
+ is_lvalue = false;
if (!same_type_p (arg2_type, arg3_type)
&& (CLASS_TYPE_P (arg2_type) || CLASS_TYPE_P (arg3_type)))
{
@@ -5187,7 +5187,7 @@ build_conditional_expr_1 (location_t loc, tree arg1, tree arg2, tree arg3,
/* We can't use result_type below, as fold might have returned a
throw_expr. */
- if (!lvalue_p)
+ if (!is_lvalue)
{
/* Expand both sides into the same slot, hopefully the target of
the ?: expression. We used to check for TARGET_EXPRs here,
@@ -6694,10 +6694,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
{
tree extype = TREE_TYPE (expr);
if (TYPE_REF_IS_RVALUE (ref_type)
- && real_lvalue_p (expr))
+ && lvalue_p (expr))
error_at (loc, "cannot bind %qT lvalue to %qT",
extype, totype);
- else if (!TYPE_REF_IS_RVALUE (ref_type) && !real_lvalue_p (expr)
+ else if (!TYPE_REF_IS_RVALUE (ref_type) && !lvalue_p (expr)
&& !CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)))
error_at (loc, "invalid initialization of non-const reference of "
"type %qT from an rvalue of type %qT", totype, extype);
@@ -10042,7 +10042,7 @@ initialize_reference (tree type, tree expr,
convert_like (conv, expr, complain);
else if (!CP_TYPE_CONST_P (TREE_TYPE (type))
&& !TYPE_REF_IS_RVALUE (type)
- && !real_lvalue_p (expr))
+ && !lvalue_p (expr))
error_at (loc, "invalid initialization of non-const reference of "
"type %qT from an rvalue of type %qT",
type, TREE_TYPE (expr));
@@ -347,7 +347,7 @@ build_base_path (enum tree_code code,
if (!want_pointer)
{
- rvalue = !real_lvalue_p (expr);
+ rvalue = !lvalue_p (expr);
/* This must happen before the call to save_expr. */
expr = cp_build_addr_expr (expr, complain);
}
@@ -2620,7 +2620,7 @@ cxx_eval_vec_init_1 (const constexpr_ctx *ctx, tree atype, tree init,
(atype, TREE_TYPE (init)));
eltinit = cp_build_array_ref (input_location, init, idx,
tf_warning_or_error);
- if (!real_lvalue_p (init))
+ if (!lvalue_p (init))
eltinit = move (eltinit);
eltinit = force_rvalue (eltinit, tf_warning_or_error);
eltinit = (cxx_eval_constant_expression
@@ -6516,10 +6516,6 @@ extern int member_p (const_tree);
extern cp_lvalue_kind real_lvalue_p (const_tree);
extern cp_lvalue_kind lvalue_kind (const_tree);
extern bool glvalue_p (const_tree);
-/* obvalue_p used to be named lvalue_p, but that didn't match the C++
- definition of lvalue. For now, let's not use the name lvalue_p in the front
- end; later we can rename real_lvalue_p to lvalue_p. */
-#define lvalue_p(T) syntax error, use real_lvalue_p
extern bool obvalue_p (const_tree);
extern bool xvalue_p (const_tree);
extern tree cp_stabilize_reference (tree);
@@ -317,7 +317,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl,
gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
- if ((flags & DIRECT_BIND) && ! real_lvalue_p (arg))
+ if ((flags & DIRECT_BIND) && ! lvalue_p (arg))
{
/* Create a new temporary variable. We can't just use a TARGET_EXPR
here because it needs to live as long as DECL. */
@@ -439,7 +439,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
= build_type_conversion (reftype, expr);
if (rval_as_conversion && rval_as_conversion != error_mark_node
- && real_lvalue_p (rval_as_conversion))
+ && lvalue_p (rval_as_conversion))
{
expr = rval_as_conversion;
rval_as_conversion = NULL_TREE;
@@ -457,7 +457,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
tree ttr = lvalue_type (expr);
if ((complain & tf_error)
- && ! real_lvalue_p (expr))
+ && ! lvalue_p (expr))
diagnose_ref_binding (loc, reftype, intype, decl);
if (! (convtype & CONV_CONST)
@@ -3750,7 +3750,7 @@ static bool
vec_copy_assign_is_trivial (tree inner_elt_type, tree init)
{
tree fromtype = inner_elt_type;
- if (real_lvalue_p (init))
+ if (lvalue_p (init))
fromtype = cp_build_reference_type (fromtype, /*rval*/false);
return is_trivially_xible (MODIFY_EXPR, inner_elt_type, fromtype);
}
@@ -489,7 +489,7 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p,
if (by_reference_p)
{
type = build_reference_type (type);
- if (!dependent_type_p (type) && !real_lvalue_p (initializer))
+ if (!dependent_type_p (type) && !lvalue_p (initializer))
error ("cannot capture %qE by reference", initializer);
}
else
@@ -6533,7 +6533,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
return NULL_TREE;
}
- if (!real_lvalue_p (expr))
+ if (!lvalue_p (expr))
{
if (complain & tf_error)
error ("%qE is not a valid template argument for type %qT "
@@ -18046,7 +18046,7 @@ maybe_adjust_types_for_deduction (unification_kind_t strict,
&& TYPE_REF_IS_RVALUE (*parm)
&& TREE_CODE (TREE_TYPE (*parm)) == TEMPLATE_TYPE_PARM
&& cp_type_quals (TREE_TYPE (*parm)) == TYPE_UNQUALIFIED
- && (arg_expr ? real_lvalue_p (arg_expr)
+ && (arg_expr ? lvalue_p (arg_expr)
/* try_one_overload doesn't provide an arg_expr, but
functions are always lvalues. */
: TREE_CODE (*arg) == FUNCTION_TYPE))
@@ -252,9 +252,7 @@ lvalue_kind (const_tree ref)
return op1_lvalue_kind;
}
-/* Returns the kind of lvalue that REF is, in the sense of
- [basic.lval]. This function should really be named lvalue_p; it
- computes the C++ definition of lvalue. */
+/* Returns the kind of lvalue that REF is, in the sense of [basic.lval]. */
cp_lvalue_kind
real_lvalue_p (const_tree ref)
@@ -266,15 +264,15 @@ real_lvalue_p (const_tree ref)
return kind;
}
-/* Defined for c-common; the front end should use real_lvalue_p. */
+/* c-common wants us to return bool. */
bool
-(lvalue_p) (const_tree t)
+lvalue_p (const_tree t)
{
return real_lvalue_p (t);
}
-/* This differs from real_lvalue_p in that xvalues are included. */
+/* This differs from lvalue_p in that xvalues are included. */
bool
glvalue_p (const_tree ref)
@@ -615,7 +613,7 @@ build_vec_init_elt (tree type, tree init, tsubst_flags_t complain)
{
tree init_type = strip_array_types (TREE_TYPE (init));
tree dummy = build_dummy_object (init_type);
- if (!real_lvalue_p (init))
+ if (!lvalue_p (init))
dummy = move (dummy);
argvec->quick_push (dummy);
}
@@ -3331,7 +3329,7 @@ error_type (tree arg)
;
else if (TREE_CODE (type) == ERROR_MARK)
;
- else if (real_lvalue_p (arg))
+ else if (lvalue_p (arg))
type = build_reference_type (lvalue_type (arg));
else if (MAYBE_CLASS_TYPE_P (type))
type = lvalue_type (arg);
@@ -4278,7 +4276,7 @@ stabilize_expr (tree exp, tree* initp)
}
else
{
- bool xval = !real_lvalue_p (exp);
+ bool xval = !lvalue_p (exp);
exp = cp_build_addr_expr (exp, tf_warning_or_error);
init_expr = get_target_expr (exp);
exp = TARGET_EXPR_SLOT (init_expr);
@@ -6296,7 +6296,7 @@ build_x_conditional_expr (location_t loc, tree ifexp, tree op1, tree op2,
/* Remember that the result is an lvalue or xvalue. */
if (glvalue_p (expr) && !glvalue_p (min))
TREE_TYPE (min) = cp_build_reference_type (TREE_TYPE (min),
- !real_lvalue_p (expr));
+ !lvalue_p (expr));
expr = convert_from_reference (min);
}
return expr;
@@ -6535,7 +6535,7 @@ maybe_warn_about_useless_cast (tree type, tree expr, tsubst_flags_t complain)
{
if ((TREE_CODE (type) == REFERENCE_TYPE
&& (TYPE_REF_IS_RVALUE (type)
- ? xvalue_p (expr) : real_lvalue_p (expr))
+ ? xvalue_p (expr) : lvalue_p (expr))
&& same_type_p (TREE_TYPE (expr), TREE_TYPE (type)))
|| same_type_p (TREE_TYPE (expr), type))
warning (OPT_Wuseless_cast, "useless cast to type %qT", type);
@@ -6637,7 +6637,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
if (TREE_CODE (type) == REFERENCE_TYPE
&& CLASS_TYPE_P (TREE_TYPE (type))
&& CLASS_TYPE_P (intype)
- && (TYPE_REF_IS_RVALUE (type) || real_lvalue_p (expr))
+ && (TYPE_REF_IS_RVALUE (type) || lvalue_p (expr))
&& DERIVED_FROM_P (intype, TREE_TYPE (type))
&& can_convert (build_pointer_type (TYPE_MAIN_VARIANT (intype)),
build_pointer_type (TYPE_MAIN_VARIANT
@@ -6984,7 +6984,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
reinterpret_cast. */
if (TREE_CODE (type) == REFERENCE_TYPE)
{
- if (! real_lvalue_p (expr))
+ if (! lvalue_p (expr))
{
if (complain & tf_error)
error ("invalid cast of an rvalue expression of type "
@@ -7231,7 +7231,7 @@ build_const_cast_1 (tree dst_type, tree expr, tsubst_flags_t complain,
{
reference_type = dst_type;
if (!TYPE_REF_IS_RVALUE (dst_type)
- ? real_lvalue_p (expr)
+ ? lvalue_p (expr)
: obvalue_p (expr))
/* OK. */;
else
@@ -1895,7 +1895,7 @@ build_m_component_ref (tree datum, tree component, tsubst_flags_t complain)
operand is a pointer to member function with ref-qualifier &&. */
if (FUNCTION_REF_QUALIFIED (type))
{
- bool lval = real_lvalue_p (datum);
+ bool lval = lvalue_p (datum);
if (lval && FUNCTION_RVALUE_QUALIFIED (type))
{
if (complain & tf_error)