Skip to content

Commit 44fc669

Browse files
palmjefacebook-github-bot
authored andcommitted
fix -Wshadow issue
Summary: -Wshadow triggered in LLVM-17: ``` fbcode/folly/futures/ThreadWheelTimekeeper.cpp:61:42: error: declaration shadows a structured binding [-Werror,-Wshadow] 61 | eventBase_.runInEventBaseThread([this, cob = std::move(cob), dur] { | ^ fbcode/folly/futures/ThreadWheelTimekeeper.cpp:47:9: note: previous declaration is here 47 | auto [cob, sf] = WTCallback<HHWheelTimer>::create(&eventBase_); | ^ ``` This seems to only be triggered in llvm-17, llvm-15 doesn't pick it up: ``` $ buck2 build -c cxx.extra_cxxflags=-Wshadow folly/futures:core ... BUILD SUCCEEDE ``` Differential Revision: D54112254
1 parent ec78cc9 commit 44fc669

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

third-party/folly/src/folly/futures/ThreadWheelTimekeeper.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ SemiFuture<Unit> ThreadWheelTimekeeper::after(HighResDuration dur) {
5858
// canceling timeout is executed in EventBase thread, the actual timeout
5959
// callback has either been executed, or will never be executed. So we are
6060
// fine here.
61-
eventBase_.runInEventBaseThread([this, cob = std::move(cob), dur] {
62-
wheelTimer_->scheduleTimeout(cob.get(), folly::chrono::ceil<Duration>(dur));
61+
eventBase_.runInEventBaseThread([this, cob2 = std::move(cob), dur] {
62+
wheelTimer_->scheduleTimeout(
63+
cob2.get(), folly::chrono::ceil<Duration>(dur));
6364
});
6465
return std::move(sf);
6566
}

0 commit comments

Comments
 (0)