From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25652 invoked by alias); 7 Jan 2012 01:32:41 -0000 Received: (qmail 25638 invoked by uid 22791); 7 Jan 2012 01:32:41 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CX X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 07 Jan 2012 01:32:26 +0000 From: "ian at airs dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/50012] [4.5/4.6/4.7 Regression] C++ front end misses -Wsign-compare warnings when extraneous parentheses are present Date: Sat, 07 Jan 2012 01:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: ian at airs dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.5.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-01/txt/msg00705.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50012 --- Comment #7 from Ian Lance Taylor 2012-01-07 01:31:36 UTC --- Created attachment 26260 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26260 Possible patch I did not like the first approach because I think that checking c_dialect_cxx in the generic C family code is quite ugly. But clearly the current approach is problematic, and it's actually easy to implement Richi's suggestion. This patch is a possible approach, but it doesn't work as is. It issues a warning for if (TYPE_QUALS (type) == memfn_quals) in cp;typeck.c. Here memfn_quals is signed int but TYPE_QUALS, an expression of enum values winds up unsigned.