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

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>:

https://gcc.gnu.org/g:185da7c2014ba41f38dd62cc719873ebf020b076

commit r14-529-g185da7c2014ba41f38dd62cc719873ebf020b076
Author: Harald Anlauf <anl...@gmx.de>
Date:   Fri May 5 21:22:12 2023 +0200

    Fortran: overloading of intrinsic binary operators [PR109641]

    Fortran allows overloading of intrinsic operators also for operands of
    numeric intrinsic types.  The intrinsic operator versions are used
    according to the rules of F2018 table 10.2 and imply type conversion as
    long as the operand ranks are conformable.  Otherwise no type conversion
    shall be performed to allow the resolution of a matching user-defined
    operator.

    gcc/fortran/ChangeLog:

            PR fortran/109641
            * arith.cc (eval_intrinsic): Check conformability of ranks of
operands
            for intrinsic binary operators before performing type conversions.
            * gfortran.h (gfc_op_rank_conformable): Add prototype.
            * resolve.cc (resolve_operator): Check conformability of ranks of
            operands for intrinsic binary operators before performing type
            conversions.
            (gfc_op_rank_conformable): New helper function to compare ranks of
            operands of binary operator.

    gcc/testsuite/ChangeLog:

            PR fortran/109641
            * gfortran.dg/overload_5.f90: New test.

Reply via email to