https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120882
Bug ID: 120882 Summary: internal compiler error in /opt/compiler-explorer/gcc-trunk-20250630/include/c++/ 16.0.0/concepts since 11.1 only with -std=c++23, with c++20 works fine Product: gcc Version: 16.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mario.rodriguezb1 at um dot es Target Milestone: --- Program: ``` #include <cstdarg> #include <string_view> void print_all(const char *,...) { va_list args; va_start(args, __builtin_va_arg_pack()); std::apply([=](const std::string_view& fmt, auto... args) { print(fmt.c_str(), std::forward<decltype(args)>(args)...); }, std::tuple(std::string_view{args}...)); va_end(args); ``` Stack dump: ``` /opt/compiler-explorer/gcc-trunk-20250630/include/c++/16.0.0/concepts:59:15: required for the satisfaction of '__same_as<_Tp, _Up>'in set_diagnostic_buffer, at diagnostic.cc:1960 0x2844425 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x2866fc6 internal_error(char const*, ...) ???:0 0xaede72 fancy_abort(char const*, int, char const*) ???:0 0x284383b diagnostic_context::finish() ???:0 0x2843b87 diagnostic_context::action_after_output(diagnostic_t) ???:0 0x284430e diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x2844425 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x2865821 warning(diagnostic_option_id, char const*, ...) ???:0 0xe05148 build_type_attribute_qual_variant(tree_node*, tree_node*, int) ???:0 0xdc5dd2 cp_build_type_attribute_variant(tree_node*, tree_node*) ???:0 0xd23306 canonicalize_type_argument(tree_node*, int) ???:0 0xd69e73 coerce_template_parms(tree_node*, tree_node*, tree_node*, int, bool) ???:0 0xd4a08f lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int) ???:0 0xd4b562 tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xd4be07 tsubst(tree_node*, tree_node*, int, tree_node*) ???:0 0xc0e05a maybe_print_single_constraint_context(diagnostic_text_output_format&, tree_node*) ???:0 0x2864678 diagnostic_text_output_format::on_report_diagnostic(diagnostic_info const&, diagnostic_t) ???:0 0x2843f76 diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x2844425 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x2865821 warning(diagnostic_option_id, char const*, ...) ???:0 ``` To quickly reproduce: https://godbolt.org/z/1hGM97qvc