https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99242
--- Comment #1 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> --- There is a shorter sequence: /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header stdexcept /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header atomic /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header semaphore /usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header condition_variable ---- In file included from /usr/local/include/c++/11.0.1/condition_variable:47: /usr/local/include/c++/11.0.1/stop_token:83:29: internal compiler error: in lookup_mark, at cp/tree.c:2403 83 | swap(stop_token& __rhs) noexcept | ^~~~~~~~ 0x73cce0 lookup_mark(tree_node*, bool) ../../gcc/gcc/cp/tree.c:2403 0xa81c51 name_lookup::dedup(bool) ../../gcc/gcc/cp/name-lookup.c:482 0xa81c51 name_lookup::dedup(bool) ../../gcc/gcc/cp/name-lookup.c:477 0xa81c51 name_lookup::search_namespace_only(tree_node*) ../../gcc/gcc/cp/name-lookup.c:958 0xa831bb name_lookup::search_unqualified(tree_node*, cp_binding_level*) ../../gcc/gcc/cp/name-lookup.c:1158 0xa85eb4 lookup_name_1 ../../gcc/gcc/cp/name-lookup.c:7804 0xa860c4 lookup_name(tree_node*, LOOK_where, LOOK_want) ../../gcc/gcc/cp/name-lookup.c:7824 0xa860c4 lookup_name(tree_node*) ../../gcc/gcc/cp/name-lookup.c:7832 0x9f2eca find_last_decl ../../gcc/gcc/cp/decl2.c:1509 0x9f2eca cplus_decl_attributes(tree_node**, tree_node*, int) ../../gcc/gcc/cp/decl2.c:1595 0x9d4b8c grokfndecl ../../gcc/gcc/cp/decl.c:10061 0x9dcddd grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ../../gcc/gcc/cp/decl.c:13579 0x9e9be8 grokmethod(cp_decl_specifier_seq*, cp_declarator const*, tree_node*) ../../gcc/gcc/cp/decl.c:17564 0xa9aa68 cp_parser_save_member_function_body ../../gcc/gcc/cp/parser.c:30663 0xad7a8a cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:26326 0xaa7998 cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:25799 0xaa7998 cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:24877 0xaa9ec3 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:25193 0xaa9ec3 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:18440 0xaaae59 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:15062 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. ---- g++ (GCC) 11.0.1 20210326 (experimental) Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.