https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70135
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Tue Mar 8 20:05:21 2016 New Revision: 234064 URL: https://gcc.gnu.org/viewcvs?rev=234064&root=gcc&view=rev Log: PR c++/70135 * constexpr.c (cxx_eval_loop_expr): Forget saved values of SAVE_EXPRs even after the last iteration of the loop. * g++.dg/cpp1y/constexpr-loop4.C: New test. * g++.dg/ubsan/pr70135.C: New test. Added: trunk/gcc/testsuite/g++.dg/cpp1y/constexpr-loop4.C trunk/gcc/testsuite/g++.dg/ubsan/pr70135.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/constexpr.c trunk/gcc/testsuite/ChangeLog