[flang-commits] [PATCH] D83142: [flang] Make 'num_images()' intrinsic

Katherine Rasmussen via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jul 6 11:28:22 PDT 2020


ktras marked 2 inline comments as done.
ktras added inline comments.


================
Comment at: flang/test/Semantics/num_images.f90:14
+  !ERROR: too many actual arguments for intrinsic 'num_images'
+  print *, num_images(3.4)
+
----------------
tskeith wrote:
> Why is the error "too many actual arguments" rather than incorrect type?
I believe it is because 'num_images()' is overloaded with 3 variants and one of these has no arguments. If an argument is found that doesn't fully match the versions of 'num_images()' that do have arguments, then it seems to be interpreting those incorrect calls as an call to the version with no arguments. Thus the error being "too many actual arguments" if the argument is of an unexpected type or "unknown keyword argument" if a correct keyword argument is used, but with an incorrect type. I haven't looked into if there is a way to change the logic of the errors being produced in these cases.


================
Comment at: flang/test/Semantics/num_images.f90:22
+  !ERROR: unknown keyword argument to intrinsic 'num_images'
+  print *, num_images(team_number=3.4)
+
----------------
tskeith wrote:
> Similar question here: `team_number` isn't an unknown keyword argument. The value has the wrong type.
> 
> Are these bad error messages found with other intrinsics or unique to `num_images?
Replied in comment above.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83142/new/

https://reviews.llvm.org/D83142





More information about the flang-commits mailing list