public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99065] New: ASSOCIATE function selector expression "no IMPLICIT type" failure
@ 2021-02-10 18:17 pault at gcc dot gnu.org
  2021-02-13 11:58 ` [Bug fortran/99065] " dominiq at lps dot ens.fr
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pault at gcc dot gnu.org @ 2021-02-10 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99065
           Summary: ASSOCIATE function selector expression "no IMPLICIT
                    type" failure
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pault at gcc dot gnu.org
  Target Milestone: ---

Created attachment 50164
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50164&action=edit
Testcase illustrating the failure

This bug was detected in testing variations of the testcase in PR98897.

The attached fails with:
../pr98897/foo1.f90:9:20:

    9 |       print *, var%i
      |                    1
Error: Symbol ‘var’ at (1) has no IMPLICIT type

If the contained procedures 'foo' and 'bar' are interchanged it compiles and
produces the intended result.

All component references suffer from this problem. Intrinsic types are fixed up
by parse.c(gfc_fixup_sibling_symbols) but there is no simple way to do this for
derived type or class selectors.

Certain operator expressions also suffer from this problem.

It is caused by parsing and matching in gfortran being single pass. This means
that unless the specification of 'bar', in this case, has been obtained, the
type of 'var' cannot be determined and primary.c(gfc_match_varspec) is bound to
return MATCH_NO.

I am looking at either two passes for contained procedures (specification
blocks first, followed by code blocks) or a fixup in gfc_match_varspec that
looks through the derived types for successful matches.

Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-15  7:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 18:17 [Bug fortran/99065] New: ASSOCIATE function selector expression "no IMPLICIT type" failure pault at gcc dot gnu.org
2021-02-13 11:58 ` [Bug fortran/99065] " dominiq at lps dot ens.fr
2023-06-28 16:39 ` pault at gcc dot gnu.org
2024-03-15  6:53 ` cvs-commit at gcc dot gnu.org
2024-03-15  7:08 ` pault at gcc dot gnu.org

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).