Fix Clang compiler warnings (-Wunused-lambda-capture)

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
This commit is contained in:
Ferry Huberts 2023-09-02 22:08:58 +02:00
parent e54fad7fa4
commit cc929ed690
8 changed files with 7 additions and 8 deletions

View File

@ -310,7 +310,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compiler_flags(10 "-Wno-unneeded-member-function")
add_compiler_flags(10 "-Wno-unreachable-code-return")
add_compiler_flags(10 "-Wno-unsafe-buffer-usage")
add_compiler_flags(10 "-Wno-unused-lambda-capture")
add_compiler_flags(10 "-Wno-unused-member-function")
add_compiler_flags(10 "-Wno-unused-parameter")
add_compiler_flags(10 "-Wno-unused-template")

View File

@ -105,7 +105,7 @@ public:
{}
Action act() override {
return m_cv->waitFor(m_lockGuard, [this]{return false;}, std::chrono::seconds(1))
return m_cv->waitFor(m_lockGuard, []{return false;}, std::chrono::seconds(1))
.next(yieldTo(&TestCoroutineTimeout::onReady));
}

View File

@ -131,7 +131,7 @@ void runServer(v_uint16 port, v_int32 delaySeconds, v_int32 iterations, bool sta
runner.addController(controller);
runner.run([&runner, delaySeconds, iterations, stable, controller] {
runner.run([delaySeconds, iterations, stable, controller] {
for(v_int32 i = 0; i < iterations; i ++) {
std::this_thread::sleep_for(std::chrono::seconds(delaySeconds));

View File

@ -264,7 +264,7 @@ void FullAsyncClientTest::onRun() {
runner.addController(app::ControllerAsync::createShared());
runner.run([this, &runner] {
runner.run([this] {
OATPP_COMPONENT(std::shared_ptr<oatpp::async::Executor>, executor);

View File

@ -147,7 +147,7 @@ void FullAsyncTest::onRun() {
runner.addController(app::ControllerAsync::createShared());
runner.addController(app::ControllerWithInterceptorsAsync::createShared());
runner.run([this, &runner] {
runner.run([this] {
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ClientConnectionProvider>, clientConnectionProvider);
OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper);

View File

@ -149,7 +149,7 @@ void FullTest::onRun() {
runner.addController(app::BasicAuthorizationController::createShared());
runner.addController(app::BearerAuthorizationController::createShared());
runner.run([this, &runner] {
runner.run([this] {
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ClientConnectionProvider>, clientConnectionProvider);
OATPP_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, objectMapper);

View File

@ -134,7 +134,7 @@ void PipelineAsyncTest::onRun() {
runner.addController(app::ControllerAsync::createShared());
runner.run([this, &runner] {
runner.run([this] {
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ClientConnectionProvider>, clientConnectionProvider);

View File

@ -129,7 +129,7 @@ void PipelineTest::onRun() {
runner.addController(app::Controller::createShared());
runner.run([this, &runner] {
runner.run([this] {
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ClientConnectionProvider>, clientConnectionProvider);