Skip to content

Commit f5151dc

Browse files
CaslynCQ Bot
authored and
CQ Bot
committed
[overnet] Remove std::forward on lvalue reference
llvm/llvm-project#120223 became more strict about discarded value expressions. The current std::forward expressions triggered a no-discard warning/error. It seems like we can remove the `std::forward` on the lvalue reference in these visitor functions anyway to resolve this error. Fixed: 385748190 Change-Id: Iaf51848f82f0979f72a26736d33b50ad60738de4 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1179435 Commit-Queue: Auto-Submit <[email protected]> Fuchsia-Auto-Submit: Caslyn Tonelli <[email protected]> Reviewed-by: Casey Dahlin <[email protected]>
1 parent f9d86a0 commit f5151dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/connectivity/overnet/usb/overnet_usb.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ void OvernetUsb::HandleSocketReadable(async_dispatcher_t*, async::WaitBase*, zx_
327327

328328
std::visit(
329329
[this](auto& state) __TA_REQUIRES(lock_) {
330-
if (std::forward<decltype(state)>(state).ReadsWaiting()) {
330+
if (state.ReadsWaiting()) {
331331
ProcessReadsFromSocket();
332332
}
333333
},
@@ -366,7 +366,7 @@ void OvernetUsb::HandleSocketWritable(async_dispatcher_t*, async::WaitBase*, zx_
366366
std::move(state_));
367367
std::visit(
368368
[this](auto& state) __TA_REQUIRES(lock_) {
369-
if (std::forward<decltype(state)>(state).WritesWaiting()) {
369+
if (state.WritesWaiting()) {
370370
ProcessWritesToSocket();
371371
}
372372
},
@@ -610,14 +610,14 @@ void OvernetUsb::ReadComplete(fendpoint::Completion completion) {
610610
std::move(state_));
611611
std::visit(
612612
[this](auto& state) __TA_REQUIRES(lock_) {
613-
if (std::forward<decltype(state)>(state).NewSocket()) {
613+
if (state.NewSocket()) {
614614
auto request = PrepareTx();
615615

616616
if (request) {
617617
SendMagicReply(std::move(*request));
618618
}
619619
}
620-
if (std::forward<decltype(state)>(state).WritesWaiting()) {
620+
if (state.WritesWaiting()) {
621621
ProcessWritesToSocket();
622622
}
623623
},

0 commit comments

Comments
 (0)