https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84537
--- Comment #1 from Volker Reichelt <reichelt at gcc dot gnu.org> --- With a slightly modified testcase (namespace std instead of N) I get a different stack-trace: =============================== namespace std { template<int> struct A {}; } std::template A<> a; =============================== bug.cc:6:17: error: wrong number of template arguments (0, should be 1) std::template A<> a; ^ bug.cc:3:24: note: provided for 'template<int <anonymous> > struct std::A' template<int> struct A {}; ^ bug.cc:6:15: error: '<expression error>' in namespace 'std' does not name a type std::template A<> a; ^~~ bug.cc:6:15: internal compiler error: in maybe_suggest_missing_header, at cp/name-lookup.c:5519 0x620703 maybe_suggest_missing_header ../../gcc/gcc/cp/name-lookup.c:5519 0x620703 suggest_alternative_in_explicit_scope(unsigned int, tree_node*, tree_node*) ../../gcc/gcc/cp/name-lookup.c:5547 0x90cf87 cp_parser_diagnose_invalid_type_name ../../gcc/gcc/cp/parser.c:3370 0x9353ed cp_parser_parse_and_diagnose_invalid_type_name ../../gcc/gcc/cp/parser.c:3468 0x93c76f cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:12946 0x93cfd8 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:12869 0x940f32 cp_parser_declaration ../../gcc/gcc/cp/parser.c:12767 0x941341 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:12643 0x941634 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4559 0x941634 c_parse_file() ../../gcc/gcc/cp/parser.c:38866 0xa3f966 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1132 Please submit a full bug report, [etc.]