public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101735] New: Type parameter inquiries for substrings are rejected
@ 2021-08-02 21:08 anlauf at gcc dot gnu.org
  2021-08-02 21:13 ` [Bug fortran/101735] " anlauf at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-08-02 21:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101735
           Summary: Type parameter inquiries for substrings are rejected
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gcc dot gnu.org
  Target Milestone: ---

As noted by Tobias Burnus in pr100950, type parameter inquiries
(see e.g. F2018:9.4.5) are not recognized for substrings.

character(len=5)   :: str
integer, parameter :: j = str% kind      ! accepted (ok)
integer, parameter :: k = str% len       ! accepted (ok)
integer, parameter :: l = str(1:3)% len  ! not accepted
integer, parameter :: m = str(1:3)% kind ! not accepted
end

gives:

pr100950-inq.f90:4:25:

    4 | integer, parameter :: l = str(1:3)% len  ! not accepted
      |                         1
Error: Parameter 'str' at (1) has not been declared or is a variable, which
does not reduce to a constant expression
pr100950-inq.f90:5:25:

    5 | integer, parameter :: m = str(1:3)% kind ! not accepted
      |                         1
Error: Parameter 'str' at (1) has not been declared or is a variable, which
does not reduce to a constant expression

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

end of thread, other threads:[~2021-08-19  6:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 21:08 [Bug fortran/101735] New: Type parameter inquiries for substrings are rejected anlauf at gcc dot gnu.org
2021-08-02 21:13 ` [Bug fortran/101735] " anlauf at gcc dot gnu.org
2021-08-02 21:35 ` kargl at gcc dot gnu.org
2021-08-19  6:43 ` burnus 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).