diff options
author | Marek Polacek <polacek@redhat.com> | 2020-11-18 22:49:59 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-11-19 13:14:41 -0500 |
commit | 25056bdf94d5f3e66bef039702f7fae799ef16b9 (patch) | |
tree | 75c4f85b1eb7fda62c5fbf90379a9b1e7eadccbb /gcc/tree.c | |
parent | e1f07131e2d88b08f75ffea2a8dcfb16607629aa (diff) | |
download | gcc-25056bdf94d5f3e66bef039702f7fae799ef16b9.zip gcc-25056bdf94d5f3e66bef039702f7fae799ef16b9.tar.gz gcc-25056bdf94d5f3e66bef039702f7fae799ef16b9.tar.bz2 |
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.
Diffstat (limited to 'gcc/tree.c')
0 files changed, 0 insertions, 0 deletions