https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77722
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Wed Dec 7 22:35:29 2016 New Revision: 243389 URL: https://gcc.gnu.org/viewcvs?rev=243389&root=gcc&view=rev Log: Backported from mainline 2016-09-27 Jakub Jelinek <ja...@redhat.com> PR c++/77722 * cp-gimplify.c (cp_ubsan_maybe_instrument_return): Instrument also functions that have just a STATEMENT_LIST instead of BIND_EXPR, or BIND_EXPR with some statement rather than STATEMENT_LIST as body. * g++.dg/ubsan/return-4.C: New test. * g++.dg/ubsan/return-5.C: New test. * g++.dg/ubsan/return-6.C: New test. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/ubsan/return-4.C branches/gcc-6-branch/gcc/testsuite/g++.dg/ubsan/return-5.C branches/gcc-6-branch/gcc/testsuite/g++.dg/ubsan/return-6.C Modified: branches/gcc-6-branch/gcc/cp/ChangeLog branches/gcc-6-branch/gcc/cp/cp-gimplify.c branches/gcc-6-branch/gcc/testsuite/ChangeLog