https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89576
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Wed Mar 6 18:39:24 2019 New Revision: 269433 URL: https://gcc.gnu.org/viewcvs?rev=269433&root=gcc&view=rev Log: PR c++/89576 - if constexpr of lambda capture. Now that we're doing implicit lambda capture in templates, we see x here as the lambda capture. maybe_convert_cond was doing nothing in a template, so we never called mark_rvalue_use on x. As part of the broad move toward doing more processing of non-dependent expressions, let's do this conversion. * semantics.c (maybe_convert_cond): Do convert a non-dependent condition in a template. * typeck.c (condition_conversion): Handle being called in a template. Added: trunk/gcc/testsuite/g++.dg/cpp1z/constexpr-if28.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/semantics.c trunk/gcc/cp/typeck.c trunk/gcc/testsuite/g++.dg/cpp1z/constexpr-if15.C