From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E866B3856275; Fri, 6 May 2022 14:35:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E866B3856275 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/105502] [9/12/11/12/13 Regression] std::normal_distribution deserialization issue Date: Fri, 06 May 2022 14:35:06 +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: 9.4.0 X-Bugzilla-Keywords: wrong-code 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: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to cf_known_to_work short_desc cf_reconfirmed_on keywords cf_known_to_fail bug_status everconfirmed target_milestone 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 14:35:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105502 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu= .org Known to work| |8.3.0, 9.2.0 Summary|std::normal_distribution |[9/12/11/12/13 Regression] |deserialization issue |std::normal_distribution | |deserialization issue Last reconfirmed| |2022-05-06 Keywords| |wrong-code Known to fail| |10.1.0, 11.1.0, 12.1.0, | |13.0, 8.4.0, 9.3.0 Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 Target Milestone|--- |9.5 --- Comment #1 from Jonathan Wakely --- Ouch, yes, thanks for the report. This is the fix: --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -1962,10 +1962,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (__is >> __mean >> __stddev >> __saved_avail) { if (__saved_avail && (__is >> __x._M_saved)) - { - __x._M_saved_available =3D __saved_avail; - __x.param(param_type(__mean, __stddev)); - } + __x._M_saved_available =3D __saved_avail; + + if (__is) + __x.param(param_type(__mean, __stddev)); } __is.flags(__flags);=