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.
Showing
Please
register
or
sign in
to comment