On Thu, Feb 8, 2018 at 9:09 PM, Alexandre Oliva <aol...@redhat.com> wrote:
> +         /* If it was supposed to be an rvalue but it's not, adjust
> +            one of the operands so that any overload resolution
> +            taking this COND_EXPR as an operand makes the correct
> +            decisions.  See c++/84231.  */
> +         TREE_OPERAND (min, 2) = build1_loc (loc, NON_LVALUE_EXPR,
> +                                             TREE_TYPE (min),
> +                                             TREE_OPERAND (min, 2));
> +         EXPR_LOCATION_WRAPPER_P (TREE_OPERAND (min, 2)) = 1;

But that's not true, this isn't a location wrapper, it has semantic
effect.  And would be the first such use of NON_LVALUE_EXPR in a
template.

Since we're already using the type of the COND_EXPR to indicate a
glvalue, maybe lvalue_kind should say that within a template, a
COND_EXPR which got past the early check for reference type is a
prvalue.

Jason

Reply via email to