From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24936 invoked by alias); 19 Nov 2013 16:49:02 -0000 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 Received: (qmail 24722 invoked by uid 48); 19 Nov 2013 16:48:59 -0000 From: "manu at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: enhancement X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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-SW-Source: 2013-11/txt/msg01880.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D57709 --- Comment #9 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- Something has changed in the C++ FE in the meanwhile. Could you try with th= is one? Index: name-lookup.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- name-lookup.c (revision 205004) +++ name-lookup.c (working copy) @@ -1216,13 +1216,25 @@ pushdecl_maybe_friend_1 (tree x, bool is else member =3D 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 membe= r of 'this'", - x); + if (BASELINK_P (member)) + member =3D 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) =3D=3D FUNCTION_DECL + && TREE_CODE (x) !=3D FUNCTION_DECL + && !FUNCTION_POINTER_TYPE_P (TREE_TYPE (x)))) { + if (warning_at (input_location, + OPT_Wshadow, "declaration of %qD shadow= s a member of %qT", + x, current_nonlambda_class_type ()) + && DECL_P(member)) + inform (DECL_SOURCE_LOCATION (member), + "shadowed declaration is here"); + } } else if (oldglobal !=3D 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 t= he >>From gcc-bugs-return-435104-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 19 17:00:25 2013 Return-Path: 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: List-Archive: List-Post: List-Help: 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" 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: In-Reply-To: References: 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?id=59142 Charles Baylis changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |charles.baylis at linaro dot org --- Comment #5 from Charles Baylis --- Created attachment 31251 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31251&action=edit 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