[8/8] c++, lto: Use TYPE_REF_IS_LVALUE
Checks
Commit Message
gcc/cp/ChangeLog:
* decl.cc (copy_fn_p): Use TYPE_REF_IS_LVALUE.
* init.cc (maybe_warn_list_ctor): Likewise.
* method.cc (early_check_defaulted_comparison): Likewise.
* pt.cc (maybe_adjust_types_for_deduction): Likewise.
(invalid_nontype_parm_type_p): Likewise.
* tree.cc (structural_type_p): Likewise.
gcc/lto/ChangeLog:
* lto-common.cc (lto_fixup_prevailing_type): Use
TYPE_REF_IS_LVALUE.
Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
gcc/cp/decl.cc | 3 +--
gcc/cp/init.cc | 3 +--
gcc/cp/method.cc | 3 +--
gcc/cp/pt.cc | 6 ++----
gcc/cp/tree.cc | 2 +-
gcc/lto/lto-common.cc | 2 +-
6 files changed, 7 insertions(+), 12 deletions(-)
@@ -15250,8 +15250,7 @@ copy_fn_p (const_tree d)
/* Pass by value copy assignment operator. */
result = -1;
}
- else if (TYPE_REF_P (arg_type)
- && !TYPE_REF_IS_RVALUE (arg_type)
+ else if (TYPE_REF_IS_LVALUE (arg_type)
&& TYPE_MAIN_VARIANT (TREE_TYPE (arg_type)) == DECL_CONTEXT (d))
{
if (CP_TYPE_CONST_P (TREE_TYPE (arg_type)))
@@ -778,8 +778,7 @@ maybe_warn_list_ctor (tree member, tree init)
tree initlist = non_reference (parm);
/* Do not warn if the parameter is an lvalue reference to non-const. */
- if (TYPE_REF_P (parm) && !TYPE_REF_IS_RVALUE (parm)
- && !CP_TYPE_CONST_P (initlist))
+ if (TYPE_REF_IS_LVALUE (parm) && !CP_TYPE_CONST_P (initlist))
return;
tree targs = CLASSTYPE_TI_ARGS (initlist);
@@ -1207,8 +1207,7 @@ early_check_defaulted_comparison (tree fn)
tree parmtype = TREE_VALUE (parmnode);
if (CLASS_TYPE_P (parmtype))
saw_byval = true;
- else if (TYPE_REF_P (parmtype)
- && !TYPE_REF_IS_RVALUE (parmtype)
+ else if (TYPE_REF_IS_LVALUE (parmtype)
&& TYPE_QUALS (TREE_TYPE (parmtype)) == TYPE_QUAL_CONST)
{
saw_byref = true;
@@ -22772,8 +22772,7 @@ maybe_adjust_types_for_deduction (tree tparms,
too, but here handle it by stripping the reference from PARM
rather than by adding it to ARG. */
if (forwarding_reference_p (*parm, TPARMS_PRIMARY_TEMPLATE (tparms))
- && TYPE_REF_P (*arg)
- && !TYPE_REF_IS_RVALUE (*arg))
+ && TYPE_REF_IS_LVALUE (*arg))
*parm = TREE_TYPE (*parm);
/* Nothing else to do in this case. */
return 0;
@@ -27595,8 +27594,7 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
return false;
else if (TYPE_PTR_P (type))
return false;
- else if (TYPE_REF_P (type)
- && !TYPE_REF_IS_RVALUE (type))
+ else if (TYPE_REF_IS_LVALUE (type))
return false;
else if (TYPE_PTRMEM_P (type))
return false;
@@ -4928,7 +4928,7 @@ structural_type_p (tree t, bool explain)
if (SCALAR_TYPE_P (t))
return true;
/* an lvalue reference type, or */
- if (TYPE_REF_P (t) && !TYPE_REF_IS_RVALUE (t))
+ if (TYPE_REF_IS_LVALUE (t))
return true;
/* a literal class type with the following properties:
- all base classes and non-static data members are public and non-mutable
@@ -998,7 +998,7 @@ lto_fixup_prevailing_type (tree t)
TYPE_NEXT_PTR_TO (t) = TYPE_POINTER_TO (TREE_TYPE (t));
TYPE_POINTER_TO (TREE_TYPE (t)) = t;
}
- else if (TYPE_REF_P (t) && !TYPE_REF_IS_RVALUE (t))
+ else if (TYPE_REF_IS_LVALUE (t))
{
TYPE_NEXT_REF_TO (t) = TYPE_REFERENCE_TO (TREE_TYPE (t));
TYPE_REFERENCE_TO (TREE_TYPE (t)) = t;