https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89576
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Fri Mar 8 20:50:31 2019 New Revision: 269506 URL: https://gcc.gnu.org/viewcvs?rev=269506&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: branches/gcc-8-branch/gcc/testsuite/g++.dg/cpp1z/constexpr-if28.C Modified: branches/gcc-8-branch/gcc/cp/ChangeLog branches/gcc-8-branch/gcc/cp/semantics.c branches/gcc-8-branch/gcc/cp/typeck.c