From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6ECA23858D35; Fri, 5 May 2023 19:23:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6ECA23858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683314611; bh=dzDASeaU6E8F3W3a0y7xr1xsAc5qTrH1+IDRHB1W7/k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bLIRx1+Vz0Z9tALPcFGco8nWE2mckPcHq9Udk+7199648TRt4fD5ARjGiycR1csyh dvmMkcPoeFBpKubJtxsqEjjl4zkGRcbRqj26NkwUSm7lE+TvaOOYUrREubz6ATW2C+ CZCVl63bfoZKo9jXZ2yFwqd5cahEVl8VfyazfeXw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109641] Gfortran fails to overload intrinsic operator (*) if operands are complex. It works with real ones. Date: Fri, 05 May 2023 19:23:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: accepts-invalid, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: anlauf at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109641 --- Comment #16 from CVS Commits --- The master branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:185da7c2014ba41f38dd62cc719873ebf020b076 commit r14-529-g185da7c2014ba41f38dd62cc719873ebf020b076 Author: Harald Anlauf 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 conversio= ns. * 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.=