PR c++/88875 - error with explicit list constructor.
authorJason Merrill <jason@redhat.com>
Fri, 18 Jan 2019 20:35:57 +0000 (15:35 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 18 Jan 2019 20:35:57 +0000 (15:35 -0500)
commitdea93fc60d293b08d137f08d9129de6f4fc772db
tree01b860565979a75d1659e1bb91a2eccf062a56f8
parent4f4a855d82a889cebcfca150a7a43909bcb6a346
PR c++/88875 - error with explicit list constructor.

In my patch for CWG issue 2267, I changed reference_binding to clear
CONSTRUCTOR_IS_DIRECT_INIT on the argument init-list.  But that breaks if
there's another candidate for which CONSTRUCTOR_IS_DIRECT_INIT is correct.
So instead, let's encode in the conversion that we want to override the
flag.

* call.c (reference_binding): Don't modify EXPR.  Set
need_temporary_p on the ck_user conversion for a temporary.
(convert_like_real): Check it.

From-SVN: r268085
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp0x/initlist-explicit2.C [new file with mode: 0644]