This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [4.5, Patch, Fortran] PR 36704: Procedure pointer as function result


Janus,

Janus Weil wrote:
> Tobias Burnus wrote:
> > Have you tried to use a use-associated proc-pointer returning
> > procedures? I would not be surprised if that fails - at least I cannot
> > see any update module.c and glancing at the patch, module.c changes seem
> > to be required.
>
> How do you come to this conclusion? Actually use-association works
> fine AFAICS, and don't see any reason why it shouldn't.

Well, I saw several reasons - but all stuff which I though would fail
actually works. I thus surrender and declare it works.

Mikael wrote:
> PPS: How are generic intrinsics handled? I tried this, and it doesn't
> complain.

Can you give an example? In most cases there exists both a specific and
a generic version with the same name; e.g. "SIN(X)" exists as generic
procedure for all kinds of REAL and COMPLEX; however, there exists also
a specific function called "SIN" which takes the default-kind REAL as
argument.

See in the F2003 standard:
"13.6 Specific names for standard intrinsic functions"
"Except for AMAX0, AMIN0, MAX1, and MIN1, the result type of the specific
 function is the same as the result type of the corresponding generic
 function would be if it were invoked with the same arguments as the
 specific function."
Those intrinsics marked with a bullet (*) in that list cannot be used
as proc-pointer target (or as actual argument).

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]