[flang-commits] [flang] [flang][OpenMP][Semantics] Modify a semantic check which was tightly checking list items in IS_DEVICE_PTR to be only dummy arguments. (PR #74370)

via flang-commits flang-commits at lists.llvm.org
Wed Dec 6 09:23:38 PST 2023


================
@@ -39,7 +39,6 @@ subroutine bar(b1, b2, b3)
   type(c_ptr), pointer :: b2
   type(c_ptr), value :: b3
 
-  !ERROR: Variable 'c' in IS_DEVICE_PTR clause must be a dummy argument
----------------
kkwli wrote:

I think in 5.2 we deprecate all the other use of the **is_device_ptr** clause in Fortran except `type(c_ptr)` variables in order to avoid any confusion between pointer and nonpointer list item. The **has_device_address** clause should be the choice for Fortran unless it is a `type(c_ptr)` variable.

In Section 5.4.7, we have:
> If the **is_device_ptr** clause is specified on a **target** construct, if any list item is not of type **C_PTR**, the behavior is as if the list item appeared in a **has_device_addr** clause. Support for such list items in an **is_device_ptr** clause is deprecated.

In my opinion, issuing a warning message about the use being deprecated is good for the users. Furthermore, I don't think the spec wants to add more Fortran stuff to the **is_device_ptr** clause as it creates so much confusion in the past.


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


More information about the flang-commits mailing list