From 6ab282f65064d9d22b04a89b0958fefbec50ebc3 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 23 Mar 2009 16:32:53 -0400 Subject: re PR c++/39526 (-Wshadow reports shadowed declarations for parameters of unnamed temp objects) PR c++/39526 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing a parm with a parm. From-SVN: r145012 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/name-lookup.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e695ede..77c195a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-03-23 Jason Merrill + + PR c++/39526 + * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing + a parm with a parm. + 2009-03-20 Jason Merrill PR c++/28879 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 308df8c..6424569 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -1031,7 +1031,10 @@ pushdecl_maybe_friend (tree x, bool is_friend) } } - if (warn_shadow && !err) + if (warn_shadow && !err + /* Don't complain about the parms we push and then pop + while tentatively parsing a function declarator. */ + && !(TREE_CODE (x) == PARM_DECL && DECL_CONTEXT (x) == NULL_TREE)) { warning (OPT_Wshadow, "declaration of %q#D shadows a parameter", x); warning (OPT_Wshadow, "%Jshadowed declaration is here", oldlocal); -- cgit v1.1