PR c++/89576 - if constexpr of lambda capture.
authorJason Merrill <jason@redhat.com>
Wed, 6 Mar 2019 18:39:24 +0000 (13:39 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 6 Mar 2019 18:39:24 +0000 (13:39 -0500)
commit4556c5b3157f496c73f7fcd25d103ad3e6ff1874
tree45bd916b990e65427ccf824b8e924564ab3a69f7
parentd135eeb21daa79f0abf5df4dd91ab100a32e562d
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.

From-SVN: r269433
gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/g++.dg/cpp1z/constexpr-if15.C
gcc/testsuite/g++.dg/cpp1z/constexpr-if28.C [new file with mode: 0644]