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

            Bug ID: 98948
           Summary: unexpected error in procedure pointer initialization
                    or assignment with intrinsic
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xiao....@compiler-dev.com
  Target Milestone: ---

the test case is:

program test
  implicit none
  procedure(real*4), pointer :: pf => ABS

  print *, pf(-6.5_4)
  if(pf(-6.5_4) /= ABS(-6.5_4)) STOP 1

  pf => ACOS
  print *, pf(0.54030231_4)
  if(pf(0.54030231_4) /= ACOS(0.54030231_4)) STOP 2

  print *, 'PASS'
end program


the error under gfortran 10.0 is:

bbb.f90:3:41:

    3 |   procedure(real*4), pointer :: pf => ABS
      |                                         1
Error: Symbol ‘abs’ at (1) has no IMPLICIT type
bbb.f90:8:12:

    8 |   pf => ACOS
      |            1
Error: Symbol ‘acos’ at (1) has no IMPLICIT type


If annotate those two if-stmt, the test case will function well. 
And the result is:
   6.50000000    
  0.999999940    
 PASS

Reply via email to