Commit 45c3e69b by Jason Merrill Committed by Jason Merrill

* call.c (build_aggr_conv): Use get_nsdmi.

From-SVN: r233947
parent 16dc6b17
2016-03-03 Jason Merrill <jason@redhat.com>
* call.c (build_aggr_conv): Use get_nsdmi.
PR c++/51406
* typeck.c (build_static_cast_1): Avoid folding back to lvalue.
......
......@@ -897,6 +897,8 @@ build_aggr_conv (tree type, tree ctor, int flags, tsubst_flags_t complain)
if (i < CONSTRUCTOR_NELTS (ctor))
val = CONSTRUCTOR_ELT (ctor, i)->value;
else if (DECL_INITIAL (field))
val = get_nsdmi (field, /*ctor*/false);
else if (TREE_CODE (ftype) == REFERENCE_TYPE)
/* Value-initialization of reference is ill-formed. */
return NULL;
......
// { dg-do compile { target c++14 } }
struct A
{
A(int);
};
struct B
{
A a{42};
};
B f() { return {}; }
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