Commit 6864d849 by Jason Merrill Committed by Jason Merrill

* pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.

From-SVN: r246953
parent 4e64ba00
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...
......
......@@ -14413,6 +14413,8 @@ tsubst_init (tree init, tree decl, tree args,
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;
......
// { 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(); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment