Issue 240416
Summary [flang] Referencing intrinsic function lost its intrinsic interface via USE association.
Labels flang:frontend
Assignees
Reporter DanielCChen
    Consider the following code
```
module m3610
  implicit none
  intrinsic abs
contains
  subroutine check()
    if (abs(-1) /= 1) stop 1  !! If comment out this line, the compilation is successful. 
  end subroutine
end module

program ex3610
  use m3610
  implicit none
  call take(abs)
contains
  subroutine take(f)
    interface
      function f(r)
        real, intent(in) :: r
      end function
    end interface
 print *, f(-2.0)
  end subroutine
end program
```

Flang failed at the compilation as:
```
error: Semantic errors in a1.f
a1.f:13:13: error: No explicit type declared for 'abs'
    call take(abs)
 ^^^
```

If the reference to intrinsic `abs` is commented out, the compilation is successful.


_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to