+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
}
}
- 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);
+2009-03-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/39526
+ * g++.dg/warn/Wshadow-4.C: New test.
+
2009-03-23 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/39516
--- /dev/null
+// PR c++/39526
+// { dg-options "-Wshadow" }
+
+class INetURLObject
+{
+public:
+ INetURLObject(int i);
+ int GetMainURL() const;
+};
+
+int foo(int infoo) // { dg-warning "shadowed declaration" }
+{
+ int outfoo( INetURLObject( infoo ).GetMainURL()); // { dg-bogus "shadows" }
+ extern void f(int infoo);
+ struct A
+ {
+ void f(int infoo) { } // { dg-warning "shadows a parameter" }
+ };
+ return outfoo;
+}