Skip to content

Commit 1292aeb

Browse files
committed
add explicit cast
1 parent cfcf8d1 commit 1292aeb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3444,7 +3444,8 @@ void OmpStructureChecker::Enter(const parser::OmpClause::If &x) {
34443444
first != dirLeafs.end()) {
34453445
// A leaf can only appear once in a compound directive, so if `part`
34463446
// is a subsequence of `dir`, it must start here.
3447-
long firstPos{std::distance(dirLeafs.begin(), first)};
3447+
size_t firstPos{
3448+
static_cast<size_t>(std::distance(dirLeafs.begin(), first))};
34483449
llvm::ArrayRef<Directive> subSeq{
34493450
first, std::min<size_t>(dirSize - firstPos, partSize)};
34503451
return subSeq == partLeafs;

0 commit comments

Comments
 (0)