[flang-commits] [flang] [flang] Catch error on REPEAT(x, NCOPIES=array) (PR #89993)

via flang-commits flang-commits at lists.llvm.org
Wed Apr 24 14:29:25 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

<details>
<summary>Changes</summary>

The NCOPIES= argument to the intrinsic function REPEAT must be a scalar integer.

Fixes https://github.com/llvm/llvm-project/issues/89851.

---
Full diff: https://github.com/llvm/llvm-project/pull/89993.diff


1 Files Affected:

- (modified) flang/lib/Evaluate/intrinsics.cpp (+3-1) 


``````````diff
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp
index f07f94b1a022c9..1b73cadb682d98 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -777,7 +777,9 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
             {"identity", SameType, Rank::scalar, Optionality::optional},
             {"ordered", AnyLogical, Rank::scalar, Optionality::optional}},
         SameType, Rank::scalar, IntrinsicClass::transformationalFunction},
-    {"repeat", {{"string", SameCharNoLen, Rank::scalar}, {"ncopies", AnyInt}},
+    {"repeat",
+        {{"string", SameCharNoLen, Rank::scalar},
+            {"ncopies", AnyInt, Rank::scalar}},
         SameCharNoLen, Rank::scalar, IntrinsicClass::transformationalFunction},
     {"reshape",
         {{"source", SameType, Rank::array}, {"shape", AnyInt, Rank::shape},

``````````

</details>


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


More information about the flang-commits mailing list