Skip to content

Commit 2988039

Browse files
committed
Change sizeof argument name to x and add test
1 parent e415721 commit 2988039

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

flang/lib/Evaluate/intrinsics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ static const IntrinsicInterface genericIntrinsicFunction[]{
936936
OptionalDIM, // unless array is assumed-size
937937
SizeDefaultKIND},
938938
KINDInt, Rank::scalar, IntrinsicClass::inquiryFunction},
939-
{"sizeof", {{"a", AnyData, Rank::anyOrAssumedRank}}, SubscriptInt,
939+
{"sizeof", {{"x", AnyData, Rank::anyOrAssumedRank}}, SubscriptInt,
940940
Rank::scalar, IntrinsicClass::inquiryFunction},
941941
{"spacing", {{"x", SameReal}}, SameReal},
942942
{"spread",

flang/test/Intrinsics/sizeof.f90

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
! RUN: %python %S/test_errors.py %s %flang_fc1
2+
character(len=20) :: a, b
3+
if (sizeof(a) == sizeof(x=b)) then
4+
print *, "pass"
5+
else
6+
print *, "fail"
7+
end if
8+
ERROR! unknown keyword argument to intrinsic 'sizeof'
9+
print *, sizeof(a=a)
10+
end

0 commit comments

Comments
 (0)