PR c++/58714
* tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
From-SVN: r210283
2014-05-09 Jason Merrill <jason@redhat.com>
+ PR c++/58714
+ * tree.c (stabilize_expr): A stabilized prvalue is an xvalue.
+
PR c++/54348
* call.c (build_conditional_expr_1): If overload resolution finds
no match, just say "different types".
{
init_expr = get_target_expr (exp);
exp = TARGET_EXPR_SLOT (init_expr);
+ if (CLASS_TYPE_P (TREE_TYPE (exp)))
+ exp = move (exp);
+ else
+ exp = rvalue (exp);
}
else
{
--- /dev/null
+// PR c++/58714
+// { dg-do compile { target c++11 } }
+
+struct X {
+ X& operator=(const X&) = delete;
+ X& operator=(X&& ) = default;
+};
+
+void f(bool t) {
+ X a, b;
+ *(t ? &a : &b) = X();
+ (t ? a : b) = X();
+}
--- /dev/null
+// PR c++/58714
+// { dg-do run }
+
+struct X {
+ X& operator=(const X&){}
+ X& operator=(X&){__builtin_abort();}
+};
+
+int main(int argv,char**) {
+ X a, b;
+ ((argv > 2) ? a : b) = X();
+}