From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E2F763858436; Fri, 31 Mar 2023 11:58:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2F763858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680263910; bh=Ma1HHS+IHM7+XnyxARst4LbTujAJszy7zmJ/xs1bLgI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lFyExnMQlxGG625C3ND2uj3pDVV9N0CidjbUyQWVda6Z8bVdHSyE9QaeSv8DrhUwr p8M6fgT7nhCsFTK87Yqmacw3B+qn4N178NW2pJl8x8JMRzbAyp4Kz4ESwWAC96crte S083L04DEl5sfrARygN9gZgDrV8IyQ5p5cH1jICQ= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/109339] [12/13 Regression] stop_token compiled with -Og yields maybe-uninitialized Date: Fri, 31 Mar 2023 11:58:30 +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: 12.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D109339 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #8 from Jakub Jelinek --- What is the explicit _Stop_state_ref(const stop_source&) : _M_ptr(new _Stop_state_t()) { } there for, can't you use some completely unrelated type there instead (bool, stop_source*, some enum, whatever), or drop the const at least? The passing pointer to uninitialized const object or reference to uninitial= ized const object to function we don't know anything about is I think one of the design goals of Martin's change which probably not everybody will agree wit= h, but it is true that it can sometimes find bugs in code.=