{
gcc_assert (ce->value);
next = massage_init_elt (fldtype, next, nested, flags, complain);
- /* We can't actually elide the temporary when initializing a
- potentially-overlapping field from a function that returns by
- value. */
- if (ce->index
- && TREE_CODE (next) == TARGET_EXPR
- && unsafe_copy_elision_p (ce->index, next))
- TARGET_EXPR_ELIDING_P (next) = false;
++idx;
}
}
}
}
+ /* We can't actually elide the temporary when initializing a
+ potentially-overlapping field from a function that returns by
+ value. */
+ if (TREE_CODE (next) == TARGET_EXPR
+ && unsafe_copy_elision_p (field, next))
+ TARGET_EXPR_ELIDING_P (next) = false;
+
if (is_empty_field (field)
&& !TREE_SIDE_EFFECTS (next))
/* Don't add trivial initialization of an empty base/field to the
--- /dev/null
+// PR c++/116424
+// { dg-do compile { target c++20 } }
+
+struct dd {
+ char *ptr;
+ dd();
+ dd(dd &&__str);
+};
+struct v {
+ dd n{};
+ int f = -1;
+ v operator|(const v &other) const;
+};
+struct cc : v {};
+static const cc a;
+static const cc b;
+static const cc c1(a | b);
+static const cc c2{a | b};
+static const cc c3 = cc(a | b);
+static const cc c4 = cc{a | b};