From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6DA8E385DC14; Fri, 15 May 2020 23:49:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6DA8E385DC14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589586556; bh=JRDJvTJ0r8XahsvzmWV/Xy6sH5y4m939R5Ge7cLw6ng=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lqEcOZ2gXImL0VJDNr0iXueoQjmsiQ4ZEbRP42vI5w1w3jUTjGVt7hcipdc4hYmW+ dIcx2YBzJiVXD9UagXVABIgsuWyt5LO6mWI1ZTXXFyrYMpEgaupz9QrpEpPNY/Rs53 5AFsRfplTTSYi/h6Tl7+ZEHRS0/gakvJKxTvf3go= From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95156] -Wtautological-compare warns in C but not C++ Date: Fri, 15 May 2020 23:49:16 +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: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: version bug_status everconfirmed cc cf_known_to_fail keywords cf_reconfirmed_on 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, 15 May 2020 23:49:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95156 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unknown |11.0 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |msebor at gcc dot gnu.org Known to fail| |10.1.0, 11.0, 9.2.0 Keywords| |diagnostic Last reconfirmed| |2020-05-15 --- Comment #1 from Martin Sebor --- In C mode the warning function, warn_tautological_bitwise_comparison (const op_location_t &loc, tree_code code, tree lhs, tree rhs), gets a BIT_AND_EXPR while in C++ mode it's passed a NOP_EXPR that casts the result of the same BIT_AND_EXPR as in C to int. The cast seems pointless since the type of the BIT_AND_EXPR already is int. I couldn't find a version where G++ did issue the expected warning so it's = not a regression. (As an aside, the volatile qualifier isn't necessary to reproduce the bug.)=