From 4556c5b3157f496c73f7fcd25d103ad3e6ff1874 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 6 Mar 2019 13:39:24 -0500 Subject: 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/semantics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/cp/semantics.c') diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index c03e4ef..2573b77 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -646,10 +646,10 @@ maybe_convert_cond (tree cond) return NULL_TREE; /* Wait until we instantiate templates before doing conversion. */ - if (processing_template_decl) + if (type_dependent_expression_p (cond)) return cond; - if (warn_sequence_point) + if (warn_sequence_point && !processing_template_decl) verify_sequence_points (cond); /* Do the conversion. */ -- cgit v1.1