[Bug c++/97881] [11 Regression] ICE in warn_about_ambiguous_parse, at cp/parser.c:20800
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 21 20:48:29 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97881
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:0999f26098598fe0a499c5b79ad23678ccfe583a
commit r11-5232-g0999f26098598fe0a499c5b79ad23678ccfe583a
Author: Marek Polacek <polacek@redhat.com>
Date: Tue Nov 17 13:39:39 2020 -0500
c++: Fix ICE-on-invalid with -Wvexing-parse [PR97881]
This invalid (?) code broke my assumption that if decl_specifiers->type
is null, there must be any type-specifiers. Turn the assert into an if
to fix this crash.
gcc/cp/ChangeLog:
PR c++/97881
* parser.c (warn_about_ambiguous_parse): Only assume "int" if we
actually saw any type-specifiers.
gcc/testsuite/ChangeLog:
PR c++/97881
* g++.dg/warn/Wvexing-parse9.C: New test.
More information about the Gcc-bugs
mailing list