c++: ICE with int{} in template. [PR97899]
authorJason Merrill <jason@redhat.com>
Fri, 20 Nov 2020 21:50:20 +0000 (16:50 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 24 Nov 2020 19:57:56 +0000 (14:57 -0500)
commit92a30040c8d3ea4899979ec41a7e8e6a625c438d
treec4f91105a4b1b013955ef68e18f7a57c72dce78e
parentce2d9549f2b2bcb70a1a6f8f4e776e1ed427546b
c++: ICE with int{} in template. [PR97899]

split_nonconstant_init_1 was confused by a CONSTRUCTOR with non-aggregate
type, which (with COMPOUND_LITERAL_P set) we use in a template to represent
a braced functional cast.  It seems to me that there's no good reason to do
split_nonconstant_init at all in a template.

gcc/cp/ChangeLog:

PR c++/97899
* typeck2.c (store_init_value): Don't split_nonconstant_init in a
template.

gcc/testsuite/ChangeLog:

PR c++/97899
* g++.dg/cpp0x/initlist-template3.C: New test.
gcc/cp/typeck2.c
gcc/testsuite/g++.dg/cpp0x/initlist-template3.C [new file with mode: 0644]