diff options
author | Marek Polacek <polacek@redhat.com> | 2020-11-17 13:39:39 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-11-21 15:48:15 -0500 |
commit | 0999f26098598fe0a499c5b79ad23678ccfe583a (patch) | |
tree | 0d73ecd35a9fa5570977301ba2b8b3597b7a2275 /gcc/c | |
parent | 1cb50c0a0e1a535ad39da2708829ac78f0f154d8 (diff) | |
download | gcc-0999f26098598fe0a499c5b79ad23678ccfe583a.zip gcc-0999f26098598fe0a499c5b79ad23678ccfe583a.tar.gz gcc-0999f26098598fe0a499c5b79ad23678ccfe583a.tar.bz2 |
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.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions