]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/c-family/ChangeLog
re PR c++/60517 (warning/error for taking address of member of a temporary object)
authorMarc Glisse <marc.glisse@inria.fr>
Thu, 31 Jul 2014 09:33:58 +0000 (11:33 +0200)
committerMarc Glisse <glisse@gcc.gnu.org>
Thu, 31 Jul 2014 09:33:58 +0000 (09:33 +0000)
commitb4dfdc11a5440c5aaf0a86d011facaddc61806be
tree35e40a78855886e1ee834f1472e67c904d487f62
parent3e50df4de7f0daea8b3f6682cfe5f16398b4f155
re PR c++/60517 (warning/error for taking address of member of a temporary object)

2014-07-31  Marc Glisse  <marc.glisse@inria.fr>

PR c++/60517
gcc/c/
* c-typeck.c (c_finish_return): Return 0 instead of the address of
a local variable.
gcc/cp/
* typeck.c (maybe_warn_about_returning_address_of_local): Return
whether it is returning the address of a local variable.
(check_return_expr): Return 0 instead of the address of a local
variable.
gcc/c-family/
* c.opt (-Wreturn-local-addr): Move to common.opt.
gcc/
* common.opt (-Wreturn-local-addr): Moved from c.opt.
* gimple-ssa-isolate-paths.c: Include diagnostic-core.h and intl.h.
(isolate_path): New argument to avoid inserting a trap.
(find_implicit_erroneous_behaviour): Handle returning the address
of a local variable.
(find_explicit_erroneous_behaviour): Likewise.
gcc/testsuite/
* c-c++-common/addrtmp.c: New file.
* c-c++-common/uninit-G.c: Adapt.

From-SVN: r213323
12 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/common.opt
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/gimple-ssa-isolate-paths.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/addrtmp.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/uninit-G.c