@@ -2133,8 +2133,8 @@ implicit_conversion (tree to, tree from, tree expr, bool c_cast_p,
flags, complain);
if (!conv || conv->bad_p)
return conv;
- if (conv_is_prvalue (conv)
- && CLASS_TYPE_P (conv->type)
+ if (CLASS_TYPE_P (conv->type)
+ && conv_is_prvalue (conv)
&& CLASSTYPE_PURE_VIRTUALS (conv->type))
conv->bad_p = true;
return conv;
@@ -8733,8 +8733,7 @@ conv_is_prvalue (conversion *c)
return true;
if (c->kind == ck_user && !TYPE_REF_P (c->type))
return true;
- if (c->kind == ck_identity && c->u.expr
- && TREE_CODE (c->u.expr) == TARGET_EXPR)
+ if (c->kind == ck_identity && c->u.expr && !glvalue_p (c->u.expr))
return true;
return false;
@@ -10192,8 +10191,7 @@ build_special_member_call (tree instance, tree name, vec<tree, va_gc> **args,
&& CONSTRUCTOR_NELTS (arg) == 1)
arg = CONSTRUCTOR_ELT (arg, 0)->value;
- if ((TREE_CODE (arg) == TARGET_EXPR
- || TREE_CODE (arg) == CONSTRUCTOR)
+ if (!glvalue_p (arg)
&& (same_type_ignoring_top_level_qualifiers_p
(class_type, TREE_TYPE (arg))))
{