)]}'
{
  "commit": "5a457c7ba71bebfa1c07a4d4bba8a13b03bba2f4",
  "tree": "ed074ed5252e0981892c155e15de0a20ec8dbe96",
  "parents": [
    "8c51b32041fdffa67d304aebb39259d1017e5857"
  ],
  "author": {
    "name": "Jonathan Wakely",
    "email": "jwakely@redhat.com",
    "time": "Wed Jul 29 19:04:37 2026 +0100"
  },
  "committer": {
    "name": "Jonathan Wakely",
    "email": "redi@gcc.gnu.org",
    "time": "Fri Jul 31 11:24:13 2026 +0100"
  },
  "message": "libstdc++: Make chrono::parse accept out-of-range values that aren\u0027t needed [PR126364]\n\nWhen parsing a time with %R or %T we should ignore out of range hours\nand minutes if the type being parsed doesn\u0027t need them, e.g. when\nparsing a chrono::year_month_day from \"2026-07-29 99:99:99\" we do not\nset failbit, and should continue parsing after the invalid hours and\nminutes.\n\nBecause we were short circuiting as soon as we saw \"99\" (in either\nfield) we didn\u0027t parse to the end of the %R or %T field, and then could\nset failbit if there were any subsequent characters or flags to parse.\n\nThe fix is to only short-circuit when setting failbit, and continue\nparsing otherwise.\n\nWith this change, we no longer hit the \u0027break\u0027 when __read_unsigned(2)\nreturns -1 (e.g. because the input was non-numeric) unless we\u0027re\nparsing a type that needs the %R or %T value. But that\u0027s OK, because\n__read_unsigned sets failbit when it returns -1 and so the next\n__read_chr or __read_unsigned will fail without extracting more\ncharacters, and we\u0027ll break there instead. So there\u0027s no change in\nobservable behaviour for non-numeric inputs, only for out-of-range\nnumeric inputs.\n\nlibstdc++-v3/ChangeLog:\n\n\tPR libstdc++/126364\n\t* include/bits/chrono_io.h (_Parser::operator()) \u003cR\u003e: Only break\n\tearly when setting failbit.\n\t* testsuite/std/time/parse/126364.cc: New test.\n\nReviewed-by: Tomasz Kamiński \u003ctkaminsk@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c5170368f82f034c6fc9b89c681a40d0897e6a43",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/include/bits/chrono_io.h",
      "new_id": "0044b5a2ecc854df43b8938ec06577f9a2df4819",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/include/bits/chrono_io.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "43739e46c414d7c26251ce1c4fe97baf2fdde308",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/testsuite/std/time/parse/126364.cc"
    }
  ]
}
