[flang-commits] [PATCH] D122438: [flang] Mark C_ASSOCIATED specific procedures as PURE

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Mar 24 15:49:06 PDT 2022


klausler created this revision.
klausler added a reviewer: mleair.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

The interfaces to C_ASSOCIATED()'s specific procedures must be
PURE so that they are accepted for use in specification expressions.


https://reviews.llvm.org/D122438

Files:
  flang/module/iso_c_binding.f90


Index: flang/module/iso_c_binding.f90
===================================================================
--- flang/module/iso_c_binding.f90
+++ flang/module/iso_c_binding.f90
@@ -90,7 +90,7 @@
 
  contains
 
-  logical function c_associated_c_ptr(c_ptr_1, c_ptr_2)
+  pure logical function c_associated_c_ptr(c_ptr_1, c_ptr_2)
     type(c_ptr), intent(in) :: c_ptr_1
     type(c_ptr), intent(in), optional :: c_ptr_2
     if (c_ptr_1%__address == c_null_ptr%__address) then
@@ -102,7 +102,7 @@
     end if
   end function c_associated_c_ptr
 
-  logical function c_associated_c_funptr(c_funptr_1, c_funptr_2)
+  pure logical function c_associated_c_funptr(c_funptr_1, c_funptr_2)
     type(c_funptr), intent(in) :: c_funptr_1
     type(c_funptr), intent(in), optional :: c_funptr_2
     if (c_funptr_1%__address == c_null_ptr%__address) then


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122438.418064.patch
Type: text/x-patch
Size: 843 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220324/7d6d5629/attachment.bin>


More information about the flang-commits mailing list