public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/98445] New: Bogus error: derived type used as an actual argument
@ 2020-12-25 21:24 townsend at astro dot wisc.edu
  2020-12-26 11:01 ` [Bug fortran/98445] " anlauf at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: townsend at astro dot wisc.edu @ 2020-12-25 21:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98445
           Summary: Bogus error: derived type used as an actual argument
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: townsend at astro dot wisc.edu
  Target Milestone: ---

Created attachment 49844
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49844&action=edit
Minimal working example

I'm running into what I believe to be a bogus error, when passing a function
that (via interface overloading) has the same name as a derived type.

Attached is a MWE. When compiled, I get the error

passed_procedure_bug.f90:30:11:

   30 |     call s(t)
      |           1
Error: Derived type 't' is used as an actual argument at (1)

cheers,

Rich

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

* [Bug fortran/98445] Bogus error: derived type used as an actual argument
  2020-12-25 21:24 [Bug fortran/98445] New: Bogus error: derived type used as an actual argument townsend at astro dot wisc.edu
@ 2020-12-26 11:01 ` anlauf at gcc dot gnu.org
  2020-12-26 20:13 ` townsend at astro dot wisc.edu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-12-26 11:01 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-12-26
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1

--- Comment #1 from anlauf at gcc dot gnu.org ---
Can you explain when did this become valid?  And which compiler accepts this?

Intel v21 also rejects it with a similar error:

pr98445.f90(31): error #6478: A type-name must not be used as a variable.   [T]
    call s(t)
-----------^

plus some more.

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

* [Bug fortran/98445] Bogus error: derived type used as an actual argument
  2020-12-25 21:24 [Bug fortran/98445] New: Bogus error: derived type used as an actual argument townsend at astro dot wisc.edu
  2020-12-26 11:01 ` [Bug fortran/98445] " anlauf at gcc dot gnu.org
@ 2020-12-26 20:13 ` townsend at astro dot wisc.edu
  2020-12-27 19:56 ` townsend at astro dot wisc.edu
  2020-12-27 21:56 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: townsend at astro dot wisc.edu @ 2020-12-26 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Rich Townsend <townsend at astro dot wisc.edu> ---
I know it's acceptable to overload a type name with one or more functions --
from 12.4.3.4.1 of the F2008 standard,

"A generic name may be the same as a derived-type name, in which case all of
the procedures in the interface block shall be functions."

In reading the rules for actual and dummy arguments (12.5.2), I don't see
anything prohibiting a function-overloaded type name being passed in. However,
I'm going to hit up comp.lang.fortran to see if I can get advice from one of
the Fortran congnescenti.

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

* [Bug fortran/98445] Bogus error: derived type used as an actual argument
  2020-12-25 21:24 [Bug fortran/98445] New: Bogus error: derived type used as an actual argument townsend at astro dot wisc.edu
  2020-12-26 11:01 ` [Bug fortran/98445] " anlauf at gcc dot gnu.org
  2020-12-26 20:13 ` townsend at astro dot wisc.edu
@ 2020-12-27 19:56 ` townsend at astro dot wisc.edu
  2020-12-27 21:56 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: townsend at astro dot wisc.edu @ 2020-12-27 19:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Rich Townsend <townsend at astro dot wisc.edu> ---
OK, my code isn't valid -- it's not permitted to pass a generic procedure name
as an actual argument. As such, gfortran is correct in its behavior.

Happy for this one to be closed -- sorry for the false alarm!

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

* [Bug fortran/98445] Bogus error: derived type used as an actual argument
  2020-12-25 21:24 [Bug fortran/98445] New: Bogus error: derived type used as an actual argument townsend at astro dot wisc.edu
                   ` (2 preceding siblings ...)
  2020-12-27 19:56 ` townsend at astro dot wisc.edu
@ 2020-12-27 21:56 ` anlauf at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-12-27 21:56 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #4 from anlauf at gcc dot gnu.org ---
OK, closing as invalid as suggested by the original submitter.

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

end of thread, other threads:[~2020-12-27 21:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-25 21:24 [Bug fortran/98445] New: Bogus error: derived type used as an actual argument townsend at astro dot wisc.edu
2020-12-26 11:01 ` [Bug fortran/98445] " anlauf at gcc dot gnu.org
2020-12-26 20:13 ` townsend at astro dot wisc.edu
2020-12-27 19:56 ` townsend at astro dot wisc.edu
2020-12-27 21:56 ` anlauf 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).