[flang-commits] [flang] [flang] Silence errors on C_LOC/C_FUNLOC in specification expressions (PR #96108)

via flang-commits flang-commits at lists.llvm.org
Wed Jun 19 14:09:15 PDT 2024


================
@@ -182,7 +182,10 @@
     __builtin_c_ptr_ne = x%__address /= y%__address
   end function
 
-  function __builtin_c_funloc(x)
+  ! Semantics has some special-case code that allows c_funloc()
+  ! to appear in a specification expression and exempts it
+  ! from the requirement that "x" be a pure dummy procedure.
+  pure function __builtin_c_funloc(x)
----------------
jeanPerier wrote:

It is not clear to me if the following is legal (flang currently accepts it, gfortran refuses it. One could argue C1515 restriction does not apply to intrinsic module procedures). If it is legal, wouldn't it be impacted by that change?

```
subroutine test(p)
 use ISO_C_BINDING
 procedure(c_funloc) :: p
end subroutine
```

https://github.com/llvm/llvm-project/pull/96108


More information about the flang-commits mailing list