From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C5AE73842422; Wed, 3 Feb 2021 22:49:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5AE73842422 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98947] [10/11 Regression] Incorrect warning when using a ternary operator to select one of two volatile variables to write to Date: Wed, 03 Feb 2021 22:49:22 +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: 10.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc priority 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: Wed, 03 Feb 2021 22:49:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98947 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Incorrect warning when |[10/11 Regression] |using a ternary operator to |Incorrect warning when |select one of two volatile |using a ternary operator to |variables to write to |select one of two volatile | |variables to write to Priority|P3 |P2 Target Milestone|--- |10.3 --- Comment #2 from Marek Polacek --- I think warning on (b ? x : y) =3D 27; is bogus, therefore I'd argue that this is a regression; gcc 9 didn't issue= any warnings with -std=3Dc++2a. I have a patch. Of course, we should still warn for (b ? x : y) +=3D 27; (b ? (x =3D 24) : y) =3D 25; etc.=