facebook / hhvm

A virtual machine for executing programs written in Hack.
https://hhvm.com
Other
18.14k stars 2.99k forks source link

fix -Wshadow issue #9437

Open palmje opened 7 months ago

palmje commented 7 months ago

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

facebook-github-bot commented 7 months ago

This pull request was exported from Phabricator. Differential Revision: D54112254

facebook-github-bot commented 7 months ago

This pull request was exported from Phabricator. Differential Revision: D54112254