]> gcc.gnu.org Git - gcc.git/commit
c++: Fix -fstrong-eval-order for operator &&, || and , [PR82959]
authorJakub Jelinek <jakub@redhat.com>
Wed, 3 Mar 2021 15:12:23 +0000 (16:12 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 20 Apr 2021 23:28:15 +0000 (01:28 +0200)
commit6c085d6d783f38f008ea54f80b43f6b8e8f6b971
treedb2f6d16ea603fa7175ec00bed9a4ee15b4b6674
parent12cd8e1b690a22c478f91671dd7cf5f6cf8332a7
c++: Fix -fstrong-eval-order for operator &&, || and , [PR82959]

P0145R3 added
"However, the operands are sequenced in the order prescribed for the built-in
operator" rule for overloaded operator calls when using the operator syntax.
op_is_ordered follows that, but added just the overloaded operators
added in that paper.  &&, || and comma operators had rules that
lhs is sequenced before rhs already in C++98.
The following patch adds those cases to op_is_ordered.

2021-03-03  Jakub Jelinek  <jakub@redhat.com>

PR c++/82959
* call.c (op_is_ordered): Handle TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR
and COMPOUND_EXPR.

* g++.dg/cpp1z/eval-order10.C: New test.

(cherry picked from commit 529e3b3402bd2a97b02318bd834df72815be5f0f)
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp1z/eval-order10.C [new file with mode: 0644]
This page took 0.060125 seconds and 6 git commands to generate.