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

            Bug ID: 105138
           Summary: [7,8,9,10,11,12,F95] Bogus error when function name
                    does not shadow an intrinsic when RESULT clause is
                    used
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vladimir.fuka at gmail dot com
  Target Milestone: ---

Reported at Stackoverflow by Denis Cousineau
https://stackoverflow.com/questions/71718480/gfortran-compiler-error-for-a-code-from-reputable-source/71718729?noredirect=1#comment126746262_71718729

RECURSIVE FUNCTION LOG_GAMMA(Z) RESULT(RES)
  COMPLEX,INTENT(IN) :: Z
  COMPLEX  :: RES
  RES = LOG_GAMMA(Z);
END FUNCTION LOG_GAMMA

> gfortran-12 shadow.f90 
shadow.f90:4:18:

    4 |   RES = LOG_GAMMA(Z);
      |                  1
Error: ‘x’ argument of ‘log_gamma’ intrinsic at (1) must be REAL


When the argument type agrees, the correct function is called.

Reply via email to