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 @@ -441,7 +441,7 @@ static bool HaveCompatibleLengths(
441441 evaluate::ToInt64 (type1.characterTypeSpec ().length ().GetExplicit ())};
442442 auto v2{
443443 evaluate::ToInt64 (type2.characterTypeSpec ().length ().GetExplicit ())};
444- return !v1 || !v2 || *v1 == *v2;
444+ return !v1 || !v2 || ( *v1 >= 0 ? *v1 : 0 ) == ( *v2 >= 0 ? *v2 : 0 ) ;
445445 } else {
446446 return true ;
447447 }
@@ -454,7 +454,7 @@ static bool HaveCompatibleLengths(
454454 auto v1{
455455 evaluate::ToInt64 (type1.characterTypeSpec ().length ().GetExplicit ())};
456456 auto v2{type2.knownLength ()};
457- return !v1 || !v2 || *v1 == *v2;
457+ return !v1 || !v2 || ( *v1 >= 0 ? *v1 : 0 ) == ( *v2 >= 0 ? *v2 : 0 ) ;
458458 } else {
459459 return true ;
460460 }
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