Skip to content

Commit

Permalink
[flang] Fix -Wsign-compare in check-call.cpp (NFC)
Browse files Browse the repository at this point in the history
/data/llvm-project/flang/lib/Semantics/check-call.cpp:1234:29: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
  CHECK(index >= 0 && index < actuals.size());
                      ~~~~~ ^ ~~~~~~~~~~~~~~
/data/llvm-project/flang/include/flang/Common/idioms.h:89:20: note: expanded from macro 'CHECK'
                   ^
1 error generated.
  • Loading branch information
DamonFool committed Apr 4, 2023
1 parent 74cc438 commit a8f1185
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flang/lib/Semantics/check-call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ bool CheckInterfaceForGeneric(const characteristics::Procedure &proc,
bool CheckArgumentIsConstantExprInRange(
const evaluate::ActualArguments &actuals, int index, int lowerBound,
int upperBound, parser::ContextualMessages &messages) {
CHECK(index >= 0 && index < actuals.size());
CHECK(index >= 0 && static_cast<unsigned>(index) < actuals.size());

const std::optional<evaluate::ActualArgument> &argOptional{actuals[index]};
if (!argOptional) {
Expand Down

0 comments on commit a8f1185

Please sign in to comment.