From 3a45677467c1863a57ba1aaa30e530f80685e233 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 3 Aug 2022 09:10:47 -0700 Subject: [PATCH] [libcxx][test] Silence narrowing warning --- .../range.iter.ops.distance/iterator_sentinel.pass.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp b/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp index 7e0b6aa185bc..55be446b821d 100644 --- a/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp +++ b/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp @@ -131,7 +131,10 @@ struct SizedStrideCounter { SizedStrideCounter operator++(int); int& operator*() const; bool operator==(SizedStrideCounter) const; - constexpr int operator-(SizedStrideCounter rhs) const { *minus_ += 1; return it_ - rhs.it_; } + constexpr int operator-(SizedStrideCounter rhs) const { + *minus_ += 1; + return static_cast(it_ - rhs.it_); + } }; static_assert(std::forward_iterator); static_assert(std::sized_sentinel_for);