Commit a2f1f4c3 by Andrew Pinski Committed by Andrew Pinski

re PR c++/14156 (no warning for address of parameter)

        PR c/14156
        * c-typeck.c (c_expand_return): Change check for VAR_DECL
        to use DECL_P instead.

        PR c++/14156
        * typeck.c (maybe_warn_about_returning_address_of_location):
        Change check for VAR_DECL to use DECL_P instead.

From-SVN: r78312
parent aa5fa0fc
2004-02-23 Andrew Pinski <pinskia@physics.uc.edu>
PR c/14156
* c-typeck.c (c_expand_return): Change check for VAR_DECL
to use DECL_P instead.
* config/rs6000/linux.h (OS_MISSING_POWERPC64): Define.
* config/rs6000/linux64.h (OS_MISSING_POWERPC64): Define.
......
......@@ -6211,7 +6211,7 @@ c_expand_return (tree retval)
while (TREE_CODE_CLASS (TREE_CODE (inner)) == 'r')
inner = TREE_OPERAND (inner, 0);
if (TREE_CODE (inner) == VAR_DECL
if (DECL_P (inner)
&& ! DECL_EXTERNAL (inner)
&& ! TREE_STATIC (inner)
&& DECL_CONTEXT (inner) == current_function_decl)
......
2004-02-23 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/14156
* typeck.c (maybe_warn_about_returning_address_of_location):
Change check for VAR_DECL to use DECL_P instead.
2004-02-23 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/14250
......
......@@ -5884,7 +5884,7 @@ maybe_warn_about_returning_address_of_local (tree retval)
}
}
if (TREE_CODE (whats_returned) == VAR_DECL
if (DECL_P (whats_returned)
&& DECL_NAME (whats_returned)
&& DECL_FUNCTION_SCOPE_P (whats_returned)
&& !(TREE_STATIC (whats_returned)
......
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