Skip to content

Commit 4d56eb0

Browse files
tskeithmemfrob
authored andcommitted
[flang] Fix compilation error on macOS
The call to `std::min` failed to compile with GCC on macOS due to type inference because `std::size_t` is `long unsigned int` but `std::int64_t` is `long long int`. Original-commit: flang-compiler/f18@c342575 Reviewed-on: flang-compiler/f18#977
1 parent 09e6941 commit 4d56eb0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

flang/runtime/buffer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ template<typename STORE> class FileFrame {
4141
FileOffset FrameAt() const { return fileOffset_ + frame_; }
4242
char *Frame() const { return buffer_ + start_ + frame_; }
4343
std::size_t FrameLength() const {
44-
return std::min(
45-
static_cast<std::size_t>(length_ - frame_), size_ - (start_ + frame_));
44+
return std::min<std::size_t>(length_ - frame_, size_ - (start_ + frame_));
4645
}
4746

4847
// Returns a short frame at a non-fatal EOF. Can return a long frame as well.

0 commit comments

Comments
 (0)