* decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL
PARM_DECLs.
PR c++/9400
* g++.dg/warn/Wshadow-2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63904
138bc75d-0d04-0410-961f-
82ee72b054a4
2003-03-06 Mark Mitchell <mark@codesourcery.com>
+ PR c++/9400
+ * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL
+ PARM_DECLs.
+
PR c++/9791
* class.c (get_basefndecls): Use lookup_fnfields_1.
if (oldlocal != NULL_TREE && !DECL_EXTERNAL (x)
/* Inline decls shadow nothing. */
&& !DECL_FROM_INLINE (x)
- && TREE_CODE (oldlocal) == PARM_DECL)
+ && TREE_CODE (oldlocal) == PARM_DECL
+ /* Don't check the `this' parameter. */
+ && !DECL_ARTIFICIAL (oldlocal))
{
bool err = false;
2003-03-06 Mark Mitchell <mark@codesourcery.com>
+ PR c++/9400
+ * g++.dg/warn/Wshadow-2.C: New test.
+
PR c++/9791
* g++.dg/warn/Woverloaded-1.C: New test.
--- /dev/null
+/* { dg-options "-Wshadow" } */
+
+struct A {
+ void a1 () {
+ struct B { B() {} }; // There should be no warning here.
+ }
+ void a2 () {
+ struct B { };
+ }
+};