[libcxx-commits] [PATCH] D141336: [libc++][test] Avoid MSVC constexpr bug

Casey Carter via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 9 17:48:24 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG915f2f16fbb7: [libc++][test] Avoid MSVC constexpr bug (authored by CaseyCarter).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141336/new/

https://reviews.llvm.org/D141336

Files:
  libcxx/test/std/algorithms/ranges_robust_against_nonbool_predicates.pass.cpp


Index: libcxx/test/std/algorithms/ranges_robust_against_nonbool_predicates.pass.cpp
===================================================================
--- libcxx/test/std/algorithms/ranges_robust_against_nonbool_predicates.pass.cpp
+++ libcxx/test/std/algorithms/ranges_robust_against_nonbool_predicates.pass.cpp
@@ -23,11 +23,11 @@
 
 #include "boolean_testable.h"
 
-auto unary_pred = [](int i) { return BooleanTestable(i > 0); };
+constexpr auto unary_pred = [](int i) { return BooleanTestable(i > 0); };
 static_assert(!std::same_as<decltype(unary_pred(1)), bool>);
 static_assert(std::convertible_to<decltype(unary_pred(1)), bool>);
 
-auto binary_pred = [](int i, int j) { return BooleanTestable(i < j); };
+constexpr auto binary_pred = [](int i, int j) { return BooleanTestable(i < j); };
 static_assert(!std::same_as<decltype(binary_pred(1, 2)), bool>);
 static_assert(std::convertible_to<decltype(binary_pred(1, 2)), bool>);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141336.487622.patch
Type: text/x-patch
Size: 937 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230110/f1619393/attachment.bin>


More information about the libcxx-commits mailing list