[libcxx-commits] [libcxx] 73099e7 - [libc++] NFC: Parenthesize expression to satisfy GCC 11

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 27 08:40:56 PDT 2021


Author: Louis Dionne
Date: 2021-05-27T11:41:29-04:00
New Revision: 73099e786aef9db88811338e217e1ea791bcaa2e

URL: https://github.com/llvm/llvm-project/commit/73099e786aef9db88811338e217e1ea791bcaa2e
DIFF: https://github.com/llvm/llvm-project/commit/73099e786aef9db88811338e217e1ea791bcaa2e.diff

LOG: [libc++] NFC: Parenthesize expression to satisfy GCC 11

Otherwise it issues a -Werror=parentheses suggesting parentheses.

Added: 
    

Modified: 
    libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h b/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h
index ed2f6c218704f..d7057ec5d5e53 100644
--- a/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h
+++ b/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/check_round_trip.h
@@ -20,7 +20,7 @@ constexpr void check_round_trip(stride_counting_iterator<I> const& i, std::ptrdi
 template <std::random_access_iterator I>
 constexpr void check_round_trip(stride_counting_iterator<I> const& i, std::ptr
diff _t const n) {
   assert(i.stride_count() <= 1);
-  assert(i.stride_displacement() == n < 0 ? -1 : 1);
+  assert(i.stride_displacement() == (n < 0 ? -1 : 1));
 }
 
 template <std::input_or_output_iterator I>


        


More information about the libcxx-commits mailing list