public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/89645] No IMPLICIT type error with: ASSOCIATE( X => function() ) Date: Sun, 03 Dec 2023 10:40:44 +0000 [thread overview] Message-ID: <bug-89645-4-Bgv3ao8PWH@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-89645-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89645 Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org --- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> --- Created attachment 56775 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56775&action=edit Deadend fix for this PR I got as far as I could with this fix up method. The testcase below fails and so I am going to set aside this approach and tackle what I should have done in the first place: two step parsing of contained procedures. The patch contains a fix for class array function selectors that do not work, even if the selector function is parsed first. I will make a new PR for this and will break out the patch for it and post it to the list. Paul module m implicit none type t integer :: i = 0 end type t integer :: i = 0 type(t), parameter :: test_array (2) = [t(42),t(84)], & test_scalar = t(99) end module m module class_selectors use m implicit none private public foo2 contains subroutine foo2() associate (var1 => bar3()) if (any (var1%i .ne. test_array%i)) stop 8 if (var1(2)%i .ne. test_array(2)%i) stop 9 ! associate (var3 => var1%i) ! This still fails ! print *, "yipee" ! end associate select type (x => var1) type is (t) if (any (x%i .ne. test_array%i)) stop 10 if (x(1)%i .ne. test_array(1)%i) stop 11 class default stop 12 end select end associate select type (y => bar3 ()) type is (t) print *, "yes, size of 'y' is ", size(y), y(1) class default print *, "no" end select end subroutine foo2 ! Since these functions are parsed after 'foo', the symbols were not available ! for the selectors and the fixup, tested here, was necessary. function bar3() result(res) class(t), allocatable :: res(:) allocate (res, source = test_array) end end module class_selectors use class_selectors call foo2 end
next prev parent reply other threads:[~2023-12-03 10:40 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-89645-4@http.gcc.gnu.org/bugzilla/> 2023-06-02 8:10 ` pault at gcc dot gnu.org 2023-06-28 16:39 ` pault at gcc dot gnu.org 2023-12-03 10:40 ` pault at gcc dot gnu.org [this message] 2023-12-16 10:39 ` pault at gcc dot gnu.org 2024-03-15 6:53 ` cvs-commit at gcc dot gnu.org 2024-03-15 7:07 ` pault at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-89645-4-Bgv3ao8PWH@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).