Skip to content

Commit

Permalink
[flang] Accept INDEX(..., BACK=array)
Browse files Browse the repository at this point in the history
The intrinsic table entry for INDEX mistakenly required
the optional BACK= argument to be scalar, but it's an
elemental intrinsic that can accept a conforming array.

Differential Revision: https://reviews.llvm.org/D117700
  • Loading branch information
klausler committed Jan 20, 2022
1 parent bddfb81 commit 78649a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flang/lib/Evaluate/intrinsics.cpp
Expand Up @@ -486,7 +486,7 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
{"image_status", {{"image", SameInt}, OptionalTEAM}, DefaultInt},
{"index",
{{"string", SameChar}, {"substring", SameChar},
{"back", AnyLogical, Rank::scalar, Optionality::optional},
{"back", AnyLogical, Rank::elemental, Optionality::optional},
DefaultingKIND},
KINDInt},
{"int", {{"a", AnyNumeric, Rank::elementalOrBOZ}, DefaultingKIND}, KINDInt},
Expand Down
Binary file modified flang/test/Evaluate/folding05.f90
Binary file not shown.

0 comments on commit 78649a8

Please sign in to comment.