Skip to content

Commit 37f94cd

Browse files
authored
[flang] Accept KIND(x) when x is assumed-rank (#107787)
Don't emit a bogus error about being unable to forward an assumed-rank dummy argument as an actual argument in the case of the KIND intrinsic function. Fixes #107782.
1 parent 15106c2 commit 37f94cd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

flang/lib/Evaluate/intrinsics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
587587
{"izext", {{"i", AnyInt}}, TypePattern{IntType, KindCode::exactKind, 2}},
588588
{"jzext", {{"i", AnyInt}}, DefaultInt},
589589
{"kind",
590-
{{"x", AnyIntrinsic, Rank::elemental, Optionality::required,
590+
{{"x", AnyIntrinsic, Rank::anyOrAssumedRank, Optionality::required,
591591
common::Intent::In, {ArgFlag::canBeMoldNull}}},
592592
DefaultInt, Rank::elemental, IntrinsicClass::inquiryFunction},
593593
{"lbound",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
2+
subroutine subr(ar)
3+
real(8) :: ar(..)
4+
!CHECK: PRINT *, 8_4
5+
print *, kind(ar)
6+
end

0 commit comments

Comments
 (0)