+2017-04-17 Jason Merrill <jason@redhat.com>
+
+ * pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
+
2017-04-15 Alexandre Oliva <aoliva@redhat.com>
* decl.c (name_unnamed_type): Split out of...
complain);
if (TREE_CODE (init) == AGGR_INIT_EXPR)
init = get_target_expr_sfinae (init, complain);
+ if (TREE_CODE (init) == TARGET_EXPR)
+ TARGET_EXPR_DIRECT_INIT_P (init) = true;
}
return init;
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+struct MoveOnly {
+ MoveOnly() = default;
+ MoveOnly(MoveOnly const&) = delete;
+ MoveOnly(MoveOnly&&) = default;
+};
+
+struct StoresMoveOnly {
+ StoresMoveOnly() {}
+ ~StoresMoveOnly() = default;
+
+ MoveOnly value;
+};
+
+template <class ...Args> void test(Args... args) {
+ StoresMoveOnly s(args...);
+}
+
+int main() { test(); }