[flang-commits] [flang] [Flang] Update Extensions.md for supported BIND(C) LOGICAL kind. (PR #88159)

Daniel Chen via flang-commits flang-commits at lists.llvm.org
Tue Apr 9 10:26:33 PDT 2024


https://github.com/DanielCChen created https://github.com/llvm/llvm-project/pull/88159

Flang also supports non-scalar logical dummy argument with a different KIND from C_BOOL to a bind(c) routine as well as a component in a bind(c) derived type. Update the document.

```
subroutine sub(arg)
logical(4) :: arg(4)
end
```

```
type dt
logical(4) :: comp
end type
end
```

>From 19e121b49df7a50bc6d1a735c55f4e6586ad7223 Mon Sep 17 00:00:00 2001
From: cdchen-ca <cdchen at ca.ibm.com>
Date: Tue, 9 Apr 2024 10:35:46 -0400
Subject: [PATCH] [Flang] Update Extensions.md for supported BIND(C) LOGICAL
 kind.

---
 flang/docs/Extensions.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/flang/docs/Extensions.md b/flang/docs/Extensions.md
index 4c3847291a3f3b..9030207d9bda5d 100644
--- a/flang/docs/Extensions.md
+++ b/flang/docs/Extensions.md
@@ -308,9 +308,10 @@ end
   enforce it and the constraint is not necessary for a correct
   implementation.
 * A label may follow a semicolon in fixed form source.
-* A scalar logical dummy argument to a `BIND(C)` procedure does
-  not have to have `KIND=C_BOOL` since it can be converted to/from
-  `_Bool` without loss of information.
+* A logical dummy argument to a `BIND(C)` procedure, or a logical
+  component to a `BIND(C)` derived type does not have to have
+  `KIND=C_BOOL` since it can be converted to/from `_Bool` without
+  loss of information.
 * The character length of the `SOURCE=` or `MOLD=` in `ALLOCATE`
   may be distinct from the constant character length, if any,
   of an allocated object.



More information about the flang-commits mailing list