re PR c++/87582 (Returning a reference to a data member via structured bindings dangles)
authorJakub Jelinek <jakub@redhat.com>
Thu, 11 Oct 2018 13:46:27 +0000 (15:46 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 11 Oct 2018 13:46:27 +0000 (15:46 +0200)
commitf9f3b77cf5290a8417cfc450b936039c78f6618b
tree925b629f996ac7888768a79b60da306c0fd16eb4
parent954ad1127eb4d367be1ece52e34ce15334d40c5e
re PR c++/87582 (Returning a reference to a data member via structured bindings dangles)

PR c++/87582
* typeck.c (maybe_warn_about_returning_address_of_local): If
whats_returned is a structured binding identifier and the structured
binding is a reference, recurse on its initializer.

* g++.dg/cpp1z/decomp48.C: New test.

From-SVN: r265041
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/decomp48.C [new file with mode: 0644]