https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90383
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri May 17 19:50:52 2019 New Revision: 271351 URL: https://gcc.gnu.org/viewcvs?rev=271351&root=gcc&view=rev Log: Backported from mainline 2019-05-10 Jakub Jelinek <ja...@redhat.com> PR c++/90383 * tree-inline.h (struct copy_body_data): Add do_not_fold member. * tree-inline.c (remap_gimple_op_r): Avoid folding expressions if id->do_not_fold. (copy_tree_body_r): Likewise. (copy_fn): Set id.do_not_fold to true. * g++.dg/cpp1y/constexpr-90383-1.C: New test. * g++.dg/cpp1y/constexpr-90383-2.C: New test. Added: branches/gcc-9-branch/gcc/testsuite/g++.dg/cpp1y/constexpr-90383-1.C branches/gcc-9-branch/gcc/testsuite/g++.dg/cpp1y/constexpr-90383-2.C Modified: branches/gcc-9-branch/gcc/ChangeLog branches/gcc-9-branch/gcc/testsuite/ChangeLog branches/gcc-9-branch/gcc/tree-inline.c branches/gcc-9-branch/gcc/tree-inline.h