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, 19 Nov 2013 16:49:00 -0000 [thread overview]
Message-ID: <bug-57709-4-7oJ6SSAszc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57709-4@http.gcc.gnu.org/bugzilla/>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4542 bytes --]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57709
--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Something has changed in the C++ FE in the meanwhile. Could you try with this
one?
Index: name-lookup.c
===================================================================
--- name-lookup.c (revision 205004)
+++ name-lookup.c (working copy)
@@ -1216,13 +1216,25 @@ pushdecl_maybe_friend_1 (tree x, bool is
else
member = NULL_TREE;
if (member && !TREE_STATIC (member))
{
- /* Location of previous decl is not useful in this case. */
- warning (OPT_Wshadow, "declaration of %qD shadows a member of
'this'",
- x);
+ if (BASELINK_P (member))
+ member = BASELINK_FUNCTIONS (member);
+
+ /* Do not warn if a variable shadows a function, unless
+ the variable is a function or a pointer-to-function. */
+ if (!(TREE_CODE (member) == FUNCTION_DECL
+ && TREE_CODE (x) != FUNCTION_DECL
+ && !FUNCTION_POINTER_TYPE_P (TREE_TYPE (x)))) {
+ if (warning_at (input_location,
+ OPT_Wshadow, "declaration of %qD shadows a
member of %qT",
+ x, current_nonlambda_class_type ())
+ && DECL_P(member))
+ inform (DECL_SOURCE_LOCATION (member),
+ "shadowed declaration is here");
+ }
}
else if (oldglobal != NULL_TREE
&& (VAR_P (oldglobal)
/* If the old decl is a type decl, only warn if the
old decl is an explicit typedef or if both the
>From gcc-bugs-return-435104-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 19 17:00:25 2013
Return-Path: <gcc-bugs-return-435104-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21021 invoked by alias); 19 Nov 2013 17:00:25 -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 20866 invoked by uid 48); 19 Nov 2013 17:00:22 -0000
From: "charles.baylis at linaro dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59142] [4.8 / 4.9 Regression] internal compiler error while compiling OpenCV 2.4.7
Date: Tue, 19 Nov 2013 17:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: charles.baylis at linaro dot org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc attachments.created
Message-ID: <bug-59142-4-Bt8lyOICbA@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59142-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59142-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: 2013-11/txt/msg01881.txt.bz2
Content-length: 754
http://gcc.gnu.org/bugzilla/show_bug.cgi?idY142
Charles Baylis <charles.baylis at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |charles.baylis at linaro dot org
--- Comment #5 from Charles Baylis <charles.baylis at linaro dot org> ---
Created attachment 31251
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id1251&actioníit
Reduced test case
I have attached a reduced test case (produced using c-reduce).
$ arm-unknown-linux-gnueabi-gcc -W -fPIC -O2 -c -mcpu=cortex-a9 -mthumb
reference/reduced.cpp
I did a git bisect, and that points to the problem being introduced in r172837
next prev parent reply other threads:[~2013-11-19 16:49 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 [this message]
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
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-7oJ6SSAszc@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).