[flang-commits] [flang] 5c116d5 - [flang] Mark C_ASSOCIATED specific procedures as PURE

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri Mar 25 15:04:33 PDT 2022


Author: Peter Klausler
Date: 2022-03-25T15:04:26-07:00
New Revision: 5c116d50e42f93ef4fa9a9719121378ec6b99b69

URL: https://github.com/llvm/llvm-project/commit/5c116d50e42f93ef4fa9a9719121378ec6b99b69
DIFF: https://github.com/llvm/llvm-project/commit/5c116d50e42f93ef4fa9a9719121378ec6b99b69.diff

LOG: [flang] Mark C_ASSOCIATED specific procedures as PURE

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

Differential Revision: https://reviews.llvm.org/D122438

Added: 
    

Modified: 
    flang/module/iso_c_binding.f90

Removed: 
    


################################################################################
diff  --git a/flang/module/iso_c_binding.f90 b/flang/module/iso_c_binding.f90
index 3668daab46ee8..347b917223d83 100644
--- a/flang/module/iso_c_binding.f90
+++ b/flang/module/iso_c_binding.f90
@@ -90,7 +90,7 @@ module iso_c_binding
 
  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 @@ logical function c_associated_c_ptr(c_ptr_1, c_ptr_2)
     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


        


More information about the flang-commits mailing list