diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2004-02-23 15:22:04 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2004-02-23 07:22:04 -0800 |
commit | a2f1f4c3f688814059d1911878bda275366306fe (patch) | |
tree | 98bb075b06df549ab40f11fb2ff9565873b0dde8 | |
parent | aa5fa0fc223acf9d634ffe311eeab2a825f6971d (diff) | |
download | gcc-a2f1f4c3f688814059d1911878bda275366306fe.zip gcc-a2f1f4c3f688814059d1911878bda275366306fe.tar.gz gcc-a2f1f4c3f688814059d1911878bda275366306fe.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-typeck.c | 2 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 2 |
4 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0664396..b556658 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 2f6216c..c10d3e0 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f9a710d..3930fd4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 919d3d75..aa85df5 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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) |