Commit 9d29e7af by Jason Merrill Committed by Jason Merrill

decl.c (pushdecl): Only give an error for shadowing a parm from *this* function.

	* decl.c (pushdecl): Only give an error for shadowing a parm
	from *this* function.

From-SVN: r28545
parent 75b36a2c
1999-08-05 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (pushdecl): Only give an error for shadowing a parm
from *this* function.
Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com)
* typeck2.c: Update URLs and mail addresses. * typeck2.c: Update URLs and mail addresses.
......
...@@ -4118,8 +4118,10 @@ pushdecl (x) ...@@ -4118,8 +4118,10 @@ pushdecl (x)
/* Warn if shadowing an argument at the top level of the body. */ /* Warn if shadowing an argument at the top level of the body. */
else if (oldlocal != NULL_TREE && !DECL_EXTERNAL (x) else if (oldlocal != NULL_TREE && !DECL_EXTERNAL (x)
&& TREE_CODE (oldlocal) == PARM_DECL && TREE_CODE (oldlocal) == PARM_DECL
&& TREE_CODE (x) != PARM_DECL) /* Don't complain if it's from an enclosing function. */
&& DECL_CONTEXT (oldlocal) == current_function_decl
&& TREE_CODE (x) != PARM_DECL)
{ {
/* Go to where the parms should be and see if we /* Go to where the parms should be and see if we
find them there. */ find them there. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment