Commit 8ea8b06a authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

folly: workaround AsyncTimeoutTest ICE with gcc 8

Summary:
```
folly/io/async/test/AsyncTimeoutTest.cpp: In lambda function:
folly/io/async/test/AsyncTimeoutTest.cpp:31:70: internal compiler error: Segmentation fault
       AsyncTimeout::make(manager, [&]() noexcept { value = expected; });
                                                                      ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
```

I'm using:

```
 $ /opt/rh/devtoolset-8/root/usr/bin/c++ --version
c++ (GCC) 8.2.1 20180801 (Red Hat 8.2.1-2)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

This has been fixed in gcc 8.3, but the workaround is to explicitly
name the captures as is done in this diff.

Reviewed By: yfeldblum

Differential Revision: D14702587

fbshipit-source-id: 1998ef5de8eb4df520edcc41fdc9cd9547dec824
parent 9a29672d
......@@ -26,7 +26,7 @@ TEST(AsyncTimeout, make) {
EventBase manager;
auto observer =
AsyncTimeout::make(manager, [&]() noexcept { value = expected; });
AsyncTimeout::make(manager, [&value]() noexcept { value = expected; });
observer->scheduleTimeout(std::chrono::milliseconds(100));
......@@ -41,7 +41,7 @@ TEST(AsyncTimeout, schedule) {
EventBase manager;
auto observer = AsyncTimeout::schedule(
std::chrono::milliseconds(100), manager, [&]() noexcept {
std::chrono::milliseconds(100), manager, [&value]() noexcept {
value = expected;
});
......@@ -56,7 +56,7 @@ TEST(AsyncTimeout, schedule_immediate) {
EventBase manager;
auto observer = AsyncTimeout::schedule(
std::chrono::milliseconds(0), manager, [&]() noexcept {
std::chrono::milliseconds(0), manager, [&value]() noexcept {
value = expected;
});
......@@ -70,7 +70,7 @@ TEST(AsyncTimeout, cancel_make) {
EventBase manager;
auto observer =
AsyncTimeout::make(manager, [&]() noexcept { value = expected; });
AsyncTimeout::make(manager, [&value]() noexcept { value = expected; });
std::weak_ptr<RequestContext> rctx_weak_ptr;
......@@ -102,7 +102,7 @@ TEST(AsyncTimeout, cancel_schedule) {
rctx_weak_ptr = RequestContext::saveContext();
observer = AsyncTimeout::schedule(
std::chrono::milliseconds(100), manager, [&]() noexcept {
std::chrono::milliseconds(100), manager, [&value]() noexcept {
value = expected;
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment