File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ static bool HaveCompatibleLengths(
439439 evaluate::ToInt64 (type1.characterTypeSpec ().length ().GetExplicit ())};
440440 auto v2{
441441 evaluate::ToInt64 (type2.characterTypeSpec ().length ().GetExplicit ())};
442- return !v1 || !v2 || *v1 == *v2;
442+ return !v1 || !v2 || ( *v1 >= 0 ? *v1 : 0 ) == ( *v2 >= 0 ? *v2 : 0 ) ;
443443 } else {
444444 return true ;
445445 }
@@ -452,7 +452,7 @@ static bool HaveCompatibleLengths(
452452 auto v1{
453453 evaluate::ToInt64 (type1.characterTypeSpec ().length ().GetExplicit ())};
454454 auto v2{type2.knownLength ()};
455- return !v1 || !v2 || *v1 == *v2;
455+ return !v1 || !v2 || ( *v1 >= 0 ? *v1 : 0 ) == ( *v2 >= 0 ? *v2 : 0 ) ;
456456 } else {
457457 return true ;
458458 }
Original file line number Diff line number Diff line change 1+ ! RUN: %flang -fc1 -fsyntax-only %s | FileCheck --allow-empty %s
2+ ! CHECK-NOT: error:
3+ character (0 ), allocatable :: ch
4+ allocate (character (- 1 ) :: ch)
5+ end
You can’t perform that action at this time.
0 commit comments