https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93869
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:cae5ff6036a21c9bbe521d615d88e283b80fe695 commit r10-6822-gcae5ff6036a21c9bbe521d615d88e283b80fe695 Author: Marek Polacek <pola...@redhat.com> Date: Fri Feb 21 12:58:04 2020 -0500 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 <pola...@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.