[flang-commits] [flang] [Flang] Reject keyword arguments in statement function calls (PR #198610)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Wed May 27 07:48:17 PDT 2026


================
@@ -0,0 +1,15 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+! Test F'2018 15.5.1 C1535 - keyword arguments are not allowed when the
+! interface is implicit. Statement functions have implicit interfaces.
+
+program test_stmt_func_keyword
+  integer :: f1, x, c
+
+  ! Statement function definition
+  f1(x) = x / 2
+
+  ! Calling a statement function with a keyword argument is not allowed
+  ! because statement functions have implicit interfaces.
+  !ERROR: Keyword 'x=' may not appear in a reference to a procedure with an implicit interface
+  c = f1(x=10)
----------------
eugeneepshteyn wrote:

Please also try the case `c = f1(y=10)`. Do you get just your error or also another error?

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


More information about the flang-commits mailing list