From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 901653858287; Tue, 5 Mar 2024 15:25:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 901653858287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709652340; bh=wvGnPpz0/Qb/64eB9vasq+PcsPUTHo1GCilRvbzy5CQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JhAJ14CK+k7ViXf6Gp92fxe/VSRKtQgq/ED2N2DmXPx9azoj462xiSCA/eNeNGFK4 hTwl8aICbi6u8BknbrxfjYyMDusdwASxVNn/3W+bI5bMcjcpDZ4PcKlYdlBT2DXsJ2 CTyWbSQa/IksLIrO7XaAU/dpxu7YHYZu3vI9FDOo= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114240] sys_days not being parsed with only a date in the stream Date: Tue, 05 Mar 2024 15:25:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114240 --- Comment #1 from Jonathan Wakely --- I think the problem is that I just have some generic logic that assumes all sys_time specializations are a date time, and so require both a date and a time. But obviously for sys_days we only need a date. template> basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& __is, const _CharT* __fmt, sys_time<_Duration>& __tp, basic_string<_CharT, _Traits, _Alloc>* __abbrev =3D nullptr, minutes* __offset =3D nullptr) { minutes __off{}; if (!__offset) __offset =3D &__off; using __format::_ChronoParts; auto __need =3D _ChronoParts::_Year | _ChronoParts::_Month | _ChronoParts::_Day | _ChronoParts::_TimeOfDay; This should depend on _Duration::period.=