re PR c++/77591 (decltype(auto) and ternary operator allow returning local reference...
authorJakub Jelinek <jakub@redhat.com>
Mon, 28 Nov 2016 15:21:53 +0000 (16:21 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 28 Nov 2016 15:21:53 +0000 (16:21 +0100)
commitf4bb5c171e3bcb244f90dfee5aae6e2bc9f92029
tree3be1092ec241f5429abaa264e02f87bf0fdc8cc3
parent21b0f96a821be876db185e58cadd1bd7f7d990b3
re PR c++/77591 (decltype(auto) and ternary operator allow returning local reference without a warning)

PR c++/77591
* typeck.c (maybe_warn_about_returning_address_of_local): Optimize
whats_returned through fold_for_warn.

* g++.dg/cpp1y/pr77591.C: New test.

From-SVN: r242924
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/pr77591.C [new file with mode: 0644]