re PR c++/14156 (no warning for address of parameter)
authorAndrew Pinski <pinskia@physics.uc.edu>
Mon, 23 Feb 2004 15:22:04 +0000 (15:22 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 23 Feb 2004 15:22:04 +0000 (07:22 -0800)
        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

gcc/ChangeLog
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/typeck.c

index 0664396fd604d824954453c3c65efc80be3fa8e8..b5566587d0cc087cb693e18f783b4de1dbdcfac6 100644 (file)
@@ -1,5 +1,9 @@
 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.
 
index 2f6216c2fb3418586303452ba53e7c02549fab85..c10d3e07e7f4c06c2d56a6c9a2d5b4d9b117446a 100644 (file)
@@ -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)
index f9a710dd17accd392ca5c6162f5304f44a37415c..3930fd42487c8c17196ad1919e172cf0fe27a224 100644 (file)
@@ -1,3 +1,9 @@
+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
index 919d3d75c5b0e01149784292ef41b2cde788713b..aa85df50bb8886389809e338771041e2e21cb5a7 100644 (file)
@@ -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)