Skip to content

Commit 0b79c37

Browse files
committed
Comment checks of single-element arrays
1 parent 6d0784c commit 0b79c37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flang/lib/Semantics/check-call.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ static void CheckPassGlobalVariable(
5656
}
5757
if (const ArraySpec *dims{actualFirstSymbol->GetShape()};
5858
dims && dims->IsExplicitShape()) {
59+
// tricky way to check that array has only one element
5960
if (!((*dims)[0].lbound().GetExplicit() ==
6061
(*dims)[0].ubound().GetExplicit())) {
6162
warn |= true;
@@ -83,6 +84,7 @@ static void CheckPassGlobalVariable(
8384
}
8485
if (const ArraySpec *dims{actualFirstSymbol->GetShape()};
8586
dims && dims->IsExplicitShape()) {
87+
// tricky way to check that array has only one element
8688
if (!((*dims)[0].lbound().GetExplicit() ==
8789
(*dims)[0].ubound().GetExplicit())) {
8890
warn |= true;

0 commit comments

Comments
 (0)