From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 206F43858C33; Tue, 29 Nov 2022 17:21:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 206F43858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669742483; bh=IqWrXGReL1O2Xicarivzn341+knEyKBWpnsWSs4qm0w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cxjnaas8r+zVMtAoRpbmn+kSs8dxysB9y+dnF2AKmQ0T0yc14VRuGtx7C+1aJkFSB MxiOVlf4z+bzpnT8aQga2UhRfaeHQV73RXFUkPLPdW5CnMK6BuIML8KtuIUksZ4aVv HRjcECkuKHZ8T07dfo0obdYfHHVe7Irdg5QujClQ= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107138] [12/13 regression] std::variant triggers false-positive 'may be used uninitialized' warning Date: Tue, 29 Nov 2022 17:21:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: 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=3D107138 --- Comment #10 from Jonathan Wakely --- (In reply to Marco Clemencic from comment #8) > But the warning is not issued in -O0 builds, which I believe means the co= de > is correct by itself, That's not a valid assumption. -Wmaybe-uninitialized doesn't even run for -= O0 so you won't get those warnings even for incorrect code. So you can't infer anything from the absence of such warnings with -O0.=