llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[flang] Missing diagnostic of the shape argument in c_f_pointer intrinsic

Open kkwli opened this issue 4 years ago • 1 comments

Diagnostic of the shape argument is missing.

  use, intrinsic :: iso_c_binding
  integer :: csize
  integer, pointer :: iptr(:,:)
  type(c_ptr) :: cptr
  call c_f_pointer(cptr, iptr, shape=(/csize/))
end

flang-new compiles successfully

gfortran issues the following message:

Error: SHAPE argument at (1) to C_F_POINTER must have the same size as the RANK of FPTR

kkwli avatar Nov 23 '22 21:11 kkwli

@llvm/issue-subscribers-flang-frontend

llvmbot avatar Nov 23 '22 21:11 llvmbot