same cv-qualification as, or a greater cv-qualification than, the
cv-qualification of T1. If the conversion is applied, E1 is
changed to an rvalue of type T2 that still refers to the original
- source class object (or the appropriate subobject thereof). */
+ source class object (or the appropriate subobject thereof).
+
+ FIXME we can't express an rvalue that refers to the original object;
+ we have to create a new one. */
if (CLASS_TYPE_P (t1) && CLASS_TYPE_P (t2)
&& same_or_base_type_p (TYPE_MAIN_VARIANT (t2),
TYPE_MAIN_VARIANT (t1)))
conv = build1 (IDENTITY_CONV, t1, e1);
if (!same_type_p (TYPE_MAIN_VARIANT (t1),
TYPE_MAIN_VARIANT (t2)))
- conv = build_conv (BASE_CONV, t2, conv);
+ {
+ conv = build_conv (BASE_CONV, t2, conv);
+ NEED_TEMPORARY_P (conv) = 1;
+ }
+ else
+ conv = build_conv (RVALUE_CONV, t2, conv);
return conv;
}
else
{
arg2 = convert_like (conv2, arg2);
arg2 = convert_from_reference (arg2);
- /* That may not quite have done the trick. If the two types
- are cv-qualified variants of one another, we will have
- just used an IDENTITY_CONV. */
if (!same_type_p (TREE_TYPE (arg2), arg3_type))
- arg2 = convert (arg3_type, arg2);
+ abort ();
arg2_type = TREE_TYPE (arg2);
}
else if (conv3 && !ICS_BAD_FLAG (conv3))
arg3 = convert_like (conv3, arg3);
arg3 = convert_from_reference (arg3);
if (!same_type_p (TREE_TYPE (arg3), arg2_type))
- arg3 = convert (arg2_type, arg3);
+ abort ();
arg3_type = TREE_TYPE (arg3);
}
}