https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97895
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:25056bdf94d5f3e66bef039702f7fae799ef16b9 commit r11-5178-g25056bdf94d5f3e66bef039702f7fae799ef16b9 Author: Marek Polacek <pola...@redhat.com> Date: Wed Nov 18 22:49:59 2020 -0500 c++: Fix crash with broken deduction from {} [PR97895] Unfortunately, the otherwise beautiful for (constructor_elt &elt : *CONSTRUCTOR_ELTS (init)) is not immune to an empty constructor, so we have to check CONSTRUCTOR_ELTS first. gcc/cp/ChangeLog: PR c++/97895 * pt.c (do_auto_deduction): Don't crash when the constructor has zero elements. gcc/testsuite/ChangeLog: PR c++/97895 * g++.dg/cpp0x/auto54.C: New test.