diff options
author | Marek Polacek <polacek@redhat.com> | 2020-02-21 12:58:04 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-02-24 10:48:31 -0500 |
commit | cae5ff6036a21c9bbe521d615d88e283b80fe695 (patch) | |
tree | e0b5eb1f69f35f2c5d6d4dee1e71c45ed053ab9a /gcc/analyzer/diagnostic-manager.cc | |
parent | 27bf39a8035445ffc71b551619d7c1a232498054 (diff) | |
download | gcc-cae5ff6036a21c9bbe521d615d88e283b80fe695.zip gcc-cae5ff6036a21c9bbe521d615d88e283b80fe695.tar.gz gcc-cae5ff6036a21c9bbe521d615d88e283b80fe695.tar.bz2 |
c++: Fix ICE with -Wmismatched-tags [PR93869]
This is a crash in cp_parser_check_class_key:
tree type_decl = TYPE_MAIN_DECL (type);
tree name = DECL_NAME (type_decl); // HERE
because TYPE_MAIN_DECL of type was null as it's not a class type.
Instead of checking CLASS_TYPE_P we should simply check class_key
a bit earlier (in this case it was typename_type).
2020-02-24 Marek Polacek <polacek@redhat.com>
PR c++/93869 - ICE with -Wmismatched-tags.
* parser.c (cp_parser_check_class_key): Check class_key earlier.
* g++.dg/warn/Wmismatched-tags-2.C: New test.
Diffstat (limited to 'gcc/analyzer/diagnostic-manager.cc')
0 files changed, 0 insertions, 0 deletions