c++: ICE-on-invalid with designated initializer [PR106983]
authorMarek Polacek <polacek@redhat.com>
Tue, 20 Sep 2022 18:54:57 +0000 (14:54 -0400)
committerMarek Polacek <polacek@redhat.com>
Fri, 23 Sep 2022 00:23:59 +0000 (20:23 -0400)
commit8b449dcd84334068c769a2f427812dadb95e61de
tree1723d7be6875f40e003a4b40d609d0b73d46cd42
parent279c671509d6b2fbaa8dff360c4f8d85f84a20c6
c++: ICE-on-invalid with designated initializer [PR106983]

We ICE in the code added in r12-7117: type_build_dtor_call gets
the error_mark_node because the type of 'prev' wasn't declared.

PR c++/106983

gcc/cp/ChangeLog:

* typeck2.cc (split_nonconstant_init_1): Check TYPE_P.

gcc/testsuite/ChangeLog:

* g++.dg/other/error36.C: New test.
gcc/cp/typeck2.cc
gcc/testsuite/g++.dg/other/error36.C [new file with mode: 0644]