Skip to content

Commit de7f531

Browse files
[libc][fuzz] workaround gcc's constexpr capture issue in sort fuzzer (#121684)
Fix the build problem at https://lab.llvm.org/buildbot/#/builders/131/builds/13255
1 parent 463e61a commit de7f531

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libc/test/src/stdlib/SortingTest.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ class SortingTest : public LIBC_NAMESPACE::testing::Test {
301301
// incorrect association between alignment and element size.
302302
alignas(1) uint8_t buf[BUF_SIZE];
303303

304-
const auto fill_buf = [&buf](size_t elem_size) {
304+
// GCC still requires capturing the constant ARRAY_INITIAL_VALS in the
305+
// lambda hence, let's use & to implicitly capture all needed variables
306+
// automatically.
307+
const auto fill_buf = [&](size_t elem_size) {
305308
for (size_t i = 0; i < BUF_SIZE; ++i) {
306309
buf[i] = 0;
307310
}

0 commit comments

Comments
 (0)