[flang-commits] [flang] [flang] Implement C_F_STRPOINTER (Fortran 2023) (PR #176973)
Andre Kuhlenschmidt via flang-commits
flang-commits at lists.llvm.org
Tue Jan 20 15:49:18 PST 2026
================
@@ -3251,6 +3253,184 @@ IntrinsicProcTable::Implementation::HandleC_F_Pointer(
}
}
+// Subroutine C_F_STRPOINTER from intrinsic module ISO_C_BINDING (18.2.3.5)
+// C_F_STRPOINTER(CSTRARRAY, FSTRPTR [,NCHARS]) or
+// C_F_STRPOINTER(CSTRPTR, FSTRPTR, NCHARS)
+std::optional<SpecificCall>
+IntrinsicProcTable::Implementation::HandleC_F_Strpointer(
+ ActualArguments &arguments, FoldingContext &context) const {
+ characteristics::Procedure::Attrs attrs;
+ attrs.set(characteristics::Procedure::Attr::Subroutine);
+ // The first argument can be either CSTRARRAY or CSTRPTR - we use a generic
+ // keyword since they're mutually exclusive
+ static const char *const keywords[]{
+ "cstrarray", "fstrptr", "nchars", nullptr};
+ characteristics::DummyArguments dummies;
+ if (CheckAndRearrangeArguments(arguments, context.messages(), keywords, 2)) {
----------------
akuhlens wrote:
You have indicated that there are too many optional arguments here.
https://github.com/llvm/llvm-project/pull/176973
More information about the flang-commits
mailing list