Re: [PATCH] c++: Fix ICE with -Wmismatched-tags [PR93869]

2020-02-24 Thread Jason Merrill
On 2/21/20 1:06 PM, Marek Polacek wrote: 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

[PATCH] c++: Fix ICE with -Wmismatched-tags [PR93869]

2020-02-21 Thread Marek Polacek
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