Created attachment 49844 [details] 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
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.
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.
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!
OK, closing as invalid as suggested by the original submitter.