aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-03-23 16:32:53 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-03-23 16:32:53 -0400
commit6ab282f65064d9d22b04a89b0958fefbec50ebc3 (patch)
treed0ffb49a574047022ca761c0103ed0269efb5753 /gcc/cp
parent3691626c344d5f04b933ef6c70f0c0fb58d25151 (diff)
downloadgcc-6ab282f65064d9d22b04a89b0958fefbec50ebc3.zip
gcc-6ab282f65064d9d22b04a89b0958fefbec50ebc3.tar.gz
gcc-6ab282f65064d9d22b04a89b0958fefbec50ebc3.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/name-lookup.c5
2 files changed, 10 insertions, 1 deletions
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 <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 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);