[Bug fortran/63371] New: kind() with function name (not call) as argument

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 25 15:18:00 GMT 2014


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

            Bug ID: 63371
           Summary: kind() with function name (not call) as argument
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

>From https://groups.google.com/forum/#!topic/comp.lang.fortran/lbaOSWKSmhQ

That's either a wrong-code or accepts-invalid issue, it requires some digging.
But the output "0" is surely wrong and if it is valid, it makes only sense for
functions and one has to be careful with generics.

Example, which prints "0" instead of "2". Using a subroutine, it is even
accepted instead of plainly rejected (hence accepts-invalid):


    INTERFACE
       FUNCTION f()
         INTEGER(SELECTED_INT_KIND(4)) :: f
       END FUNCTION f
     END INTERFACE

     PRINT *, KIND(f)
   END

   ! (just to provide a definition)
   FUNCTION f()
     INTEGER(SELECTED_INT_KIND(4)) :: f
   END FUNCTION f



More information about the Gcc-bugs mailing list