)]}'
{
  "commit": "50cbacfaa1e776b7ab36070f7f61873b092fd71f",
  "tree": "884f60744928a5025b96067bb663739e134dd19f",
  "parents": [
    "0487ae7658d2b9dfc82aeeb1c52ff6f034caa37b"
  ],
  "author": {
    "name": "Tomasz Kamiński",
    "email": "tkaminsk@redhat.com",
    "time": "Tue Jun 23 10:00:01 2026 +0200"
  },
  "committer": {
    "name": "Tomasz Kamiński",
    "email": "tkaminsk@redhat.com",
    "time": "Tue Jul 07 14:30:42 2026 +0200"
  },
  "message": "libstdc++: Gracefully handle unrecognized _Arg_t values in basic_format_arg.\n\nImplementing features from later revision of the standard, may require\nextending the set of types stored directly in _Arg_value (without\nchanging in size and aliment), and thus expanding the values in _Arg_t.\nHowever, any such value would be unrecognized by the TUs compiled with\nolder release, and would lead to UB (call to __builtin_unreachable).\n\nThis patch addresses above by introducing _M_handle_unrecognized method,\nthat is called instead. As specializations of this method for all\ncontext supported at runtime (format_context and wformat_context) are\nexported from libstdc++.so, the newest version (supporting all _Arg_t\nvalues introduced later) will be picked (this is ensured by not providing\ntemplate definition in header in such case).\nIn consequence, the implementation may return handle object referencing\nnew alternatives (such wrapping is already required to provide standard\ncompliant behavior of visit_format_arg).\nAs no new _Arg_t were introduced since GCC16, this method simply throws\nformat_error now, and contains appropriate comment.\n\nNote that the above is not required for formatting when __do_vformat_to\nis exported (Unicode literal encoding and C++20). It remains necessary\nin remaining cases or when visit on basic_format_arg is called by user.\nIn consequence addition of new argument types stored directly does not\nhave negative impact on performance in most common case.\n\nThis patch also removes the __type parameter from the _M_visit and\n_M_visit_user, and uses _M_type member instead. This prevents misuse,\nas the provided type was always required to match _M_type.\n\nlibstdc++-v3/ChangeLog:\n\n\t* config/abi/pre/gnu.ver (GLIBCXX_3.4.36): Export basic_format_arg\n\t_M_handle_unrecognized method of specializations of\n\tformat_context and wformat_context.\n\t* include/std/format (basic_format_arg::_M_handle_unrecognized):\n\tDeclare with explicit specializations for (w)format_context\n\tif _GLIBCXX_EXTERN_TEMPLATE, and define otherwise.\n\t(basic_format_arg::_M_visit): Remove __type parameter, and use\n\t_M_type instead. Call _M_handle_unrecognized for unrecognized\n\t_Arg_t values.\n\t(basic_format_arg::_M_visit_user): Remove __type parameter,\n\tand use _M_type instead. Adjust calls to _M_visit.\n\t(basic_format_arg::visit, std::visit_format_arg)\n\t(__format::__visit_format_arg): Remove _M_type argument from\n\t_M_visit(_user) calls.\n\t* src/c++20/format-inst.cc\n\t(basic_format_arg::_M_handle_unrecognized): Define and export\n\texplicit specializations for (w)format_context.\n\nReviewed-by: Jonathan Wakely \u003cjwakely@redhat.com\u003e\nSigned-off-by: Tomasz Kamiński \u003ctkaminsk@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3a6afac830873ac1bcb69435833acfdd9678032e",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/config/abi/pre/gnu.ver",
      "new_id": "9e1bebb4f500b107323c7430e111ea28abc33ade",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/config/abi/pre/gnu.ver"
    },
    {
      "type": "modify",
      "old_id": "8e7702d76df6bd3386d1fb6fc04881c7f1cf41af",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/include/std/format",
      "new_id": "1b4082e07a448403c618ccf125752b5005038923",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/include/std/format"
    },
    {
      "type": "modify",
      "old_id": "65a3f2827327df2af43cef86e88f320422594ee4",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/src/c++20/format-inst.cc",
      "new_id": "fe15992485e578627e30afb977b4ce8360a615bc",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/src/c++20/format-inst.cc"
    }
  ]
}
