[Bug c++/77591] [6 Regression] decltype(auto) and ternary operator allow returning local reference without a warning

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 7 22:57:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77591

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Dec  7 22:56:45 2016
New Revision: 243409

URL: https://gcc.gnu.org/viewcvs?rev=243409&root=gcc&view=rev
Log:
        Backported from mainline
        2016-11-28  Jakub Jelinek  <jakub@redhat.com>

        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.

Added:
    branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp1y/pr77591.C
Modified:
    branches/gcc-6-branch/gcc/cp/ChangeLog
    branches/gcc-6-branch/gcc/cp/typeck.c
    branches/gcc-6-branch/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list