diff options
author | Jason Merrill <jason@redhat.com> | 2009-03-23 20:32:53 +0000 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2009-03-23 20:32:53 +0000 |
commit | 60c26fa95fa2d2ddaa375658659c7c59ab3fe8b9 (patch) | |
tree | d0ffb49a574047022ca761c0103ed0269efb5753 /gcc/cp | |
parent | 47863663eca5fd9a2a9a3fe9c1c0d2c463883342 (diff) |
PR c++/39526
* name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
a parm with a parm.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@145012 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e695ede3f2d..77c195a56c8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-03-23 Jason Merrill <jason@redhat.com> + + PR c++/39526 + * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing + a parm with a parm. + 2009-03-20 Jason Merrill <jason@redhat.com> PR c++/28879 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 308df8c9c17..6424569d728 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); |