From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F296F385702C; Wed, 14 Apr 2021 20:43:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F296F385702C From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/63797] Bogus ambiguous reference to 'sqrt' Date: Wed, 14 Apr 2021 20:43:50 +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: 5.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2021 20:43:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63797 --- Comment #6 from anlauf at gcc dot gnu.org --- Steve, can you give an example for the procedure pointer case you mentioned? I played a bit, but the only valid code that I can think of did not produce a reference to sqrt in such a way that it needs to show up in the mod. Extended testcase that compiles and also uses a procedure pointer to sqrt(): ! { dg-do compile } ! PR63797 - Bogus ambiguous reference to 'sqrt' module mod1 implicit none real, parameter :: z =3D sqrt (0.0) real :: w =3D sqrt (1.0) interface pure real function sqrt_ifc (x) real, intent(in) :: x end function sqrt_ifc end interface contains pure function myroot () result (f) procedure(sqrt_ifc), pointer :: f intrinsic :: sqrt f =3D> sqrt end function myroot end module mod1 module mod2 implicit none type t real :: a =3D 0. end type interface sqrt module procedure sqrt end interface contains function sqrt (a) type(t), intent(in) :: a type(t) :: sqrt sqrt% a =3D a% a end function sqrt end module mod2 program test use mod1 use mod2 implicit none type(t) :: x, y procedure(sqrt_ifc), pointer :: root root =3D> myroot () y =3D sqrt (x) y% a =3D sqrt (x% a) + z - w + root (x% a) end program test=