[Bug c++/82959] g++ doesn't appreciate C++17 evaluation order rules for overloaded operators

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 22 16:51:38 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82959

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:cfe0485ff571a7cd27d2c1115f1fea1a5fecc17c

commit r8-10894-gcfe0485ff571a7cd27d2c1115f1fea1a5fecc17c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Mar 3 16:12:23 2021 +0100

    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)


More information about the Gcc-bugs mailing list