On 10/25/23 14:55, Patrick Palka wrote:
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look
OK for trunk?

-- >8 --

Now that we don't have to worry about looking thruogh NON_DEPENDENT_EXPR,
we can easily extend the -Wparentheses warning in convert_for_assignment
to consider (non-dependent) templated assignment operator expressions as
well, like r14-4111-g6e92a6a2a72d3b did in maybe_convert_cond.

gcc/cp/ChangeLog:

        * cp-tree.h (is_assignment_op_expr_p): Declare.
        * semantics.cc (is_assignment_op_expr_p): Generalize to return
        true for assignment operator expression, not just one that
        have been resolved to an operator overload.
        (maybe_convert_cond): Remove now-redundant checks around
        is_assignment_op_expr_p.
        * typeck.cc (convert_for_assignment): Look through implicit
        INDIRECT_REF in -Wparentheses warning logic, and generalize
        to use is_assignment_op_expr_p.

Do we want to factor out the whole warning logic rather than adjust it in both places?

Jason

Reply via email to