diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-10-27 11:14:04 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-10-27 11:14:04 -0400 |
commit | 0f2e2080685e75097c319e83eae4776fa98edd01 (patch) | |
tree | 0c219646bb2d141ea9c041b5f51e9ac19b766b0b /gcc/expr.cc | |
parent | e5f6a5ad7ceece5238fc3d63f7ea92574df4264d (diff) | |
download | gcc-0f2e2080685e75097c319e83eae4776fa98edd01.zip gcc-0f2e2080685e75097c319e83eae4776fa98edd01.tar.gz gcc-0f2e2080685e75097c319e83eae4776fa98edd01.tar.bz2 |
c++: more ahead-of-time -Wparentheses warnings
Now that we don't have to worry about looking through 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 (maybe_warn_unparenthesized_assignment): Declare.
* semantics.cc (is_assignment_op_expr_p): Generalize to return
true for any assignment operator expression, not just one that
has been resolved to an operator overload.
(maybe_warn_unparenthesized_assignment): Factored out from ...
(maybe_convert_cond): ... here.
(finish_parenthesized_expr): Mention
maybe_warn_unparenthesized_assignment.
* typeck.cc (convert_for_assignment): Replace -Wparentheses
warning logic with maybe_warn_unparenthesized_assignment.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wparentheses-13.C: Strengthen by expecting that
we issue the -Wparentheses warnings ahead of time.
* g++.dg/warn/Wparentheses-23.C: Likewise.
* g++.dg/warn/Wparentheses-32.C: Remove xfails.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions