public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57709] -Wshadow is too strict / has false positives
Date: Tue, 09 Jun 2015 09:47:00 -0000	[thread overview]
Message-ID: <bug-57709-4-nxZSOvyO2b@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57709-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709

--- Comment #16 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Gael Guennebaud from comment #15)
> -Wshadow still trigger false positive when a base member functions is
> imported with the "using" keyword, as in the following example (tested with
> gcc 5.1):

Please open a new PR. This one is fixed.

> Note that clang does not warn in this case, so it should be possible to
> figure out that in this case, the imported "size" symbol is a function and
> not a variable.

Sure, probably TREE_CODE (member) != FUNCTION_DECL but there must be a way to
check that it does represent a function_decl (or member-function). Run gcc
under gdb in your testcase and break at the call to warning_at and use "p
debug_tree(member)" to understand what member is in your testcase.
>From gcc-bugs-return-488466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 09 09:54:19 2015
Return-Path: <gcc-bugs-return-488466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 109752 invoked by alias); 9 Jun 2015 09:54:18 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 109694 invoked by uid 48); 9 Jun 2015 09:54:15 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/45780] Warning for arithmetic operations involving C99 _Bool variable
Date: Tue, 09 Jun 2015 09:54: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-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: mpolacek 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:
Message-ID: <bug-45780-4-reKioD5YdX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-45780-4@http.gcc.gnu.org/bugzilla/>
References: <bug-45780-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg00798.txt.bz2
Content-length: 327

https://gcc.gnu.org/bugzilla/show_bug.cgi?idE780

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think -Wbool-arith makes sense as a separate option.  While -Wc90-c99-compat
warns about any use of bool (in a declaration, cast, ...), -Wbool-arith would
only warn about suspicious uses of boolean vars.


      parent reply	other threads:[~2015-06-09  9:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 13:52 [Bug c++/57709] New: " jan.kratochvil at redhat dot com
2013-06-25 15:52 ` [Bug c++/57709] " pinskia at gcc dot gnu.org
2013-06-25 16:17 ` jakub at gcc dot gnu.org
2013-06-25 16:40 ` jan.kratochvil at redhat dot com
2013-06-25 16:46 ` manu at gcc dot gnu.org
2013-06-25 18:00 ` manu at gcc dot gnu.org
2013-11-19  6:31 ` manu at gcc dot gnu.org
2013-11-19 13:40 ` jan.kratochvil at redhat dot com
2013-11-19 16:49 ` manu at gcc dot gnu.org
2013-11-19 17:15 ` jan.kratochvil at redhat dot com
2013-12-14  7:57 ` jan.kratochvil at redhat dot com
2013-12-17 22:35 ` joseph at codesourcery dot com
2014-08-22 19:13 ` manu at gcc dot gnu.org
2015-06-09  9:33 ` gael.guennebaud at gmail dot com
2015-06-09  9:47 ` manu at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-57709-4-nxZSOvyO2b@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).