* pt.c (tsubst_init): Set TARGET_EXPR_DIRECT_INIT_P.
From-SVN: r246953
This commit is contained in:
parent
4e64ba0091
commit
6864d84921
3 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
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;
|
||||
|
|
20
gcc/testsuite/g++.dg/cpp0x/variadic-init2.C
Normal file
20
gcc/testsuite/g++.dg/cpp0x/variadic-init2.C
Normal file
|
@ -0,0 +1,20 @@
|
|||
// { 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(); }
|
Loading…
Add table
Reference in a new issue