From 356fc301251378e0f6fa6aa794d73714202887ac Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 12 Jan 2023 09:03:40 -0800 Subject: [PATCH] Fix -Wshadow warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../googlemock/test/gmock-actions_test.cc:687:36: warning: declaration of ‘v’ shadows a member of ‘testing::{anonymous}::ReturnTest_SupportsReferenceLikeReturnType_Test::TestBody()::Result’ [-Wshadow] 687 | Result(const std::vector& v) : v(&v) {} // NOLINT | ~~~~~~~~~~~~~~~~~~~~~~~~^ ../googlemock/test/gmock-actions_test.cc:686:29: note: shadowed declaration is here 686 | const std::vector* v; | ^ ../googlemock/test/gmock-actions_test.cc: In constructor ‘testing::{anonymous}::ReturnTest_PrefersConversionOperator_Test::TestBody()::Out::Out(int)’: ../googlemock/test/gmock-actions_test.cc:720:28: warning: declaration of ‘x’ shadows a member of ‘testing::{anonymous}::ReturnTest_PrefersConversionOperator_Test::TestBody()::Out’ [-Wshadow] 720 | explicit Out(const int x) : x(x) {} | ~~~~~~~~~~^ ../googlemock/test/gmock-actions_test.cc:718:9: note: shadowed declaration is here 718 | int x; | ^ PiperOrigin-RevId: 501580618 Change-Id: I584710fbbe440ec724f88746e51f3be5653c32d5 --- googlemock/test/gmock-actions_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc index e5a7ae13..510d15c8 100644 --- a/googlemock/test/gmock-actions_test.cc +++ b/googlemock/test/gmock-actions_test.cc @@ -684,7 +684,7 @@ TEST(ReturnTest, SupportsReferenceLikeReturnType) { // A reference wrapper for std::vector, implicitly convertible from it. struct Result { const std::vector* v; - Result(const std::vector& v) : v(&v) {} // NOLINT + Result(const std::vector& vec) : v(&vec) {} // NOLINT }; // Set up an action for a mock function that returns the reference wrapper @@ -717,7 +717,7 @@ TEST(ReturnTest, PrefersConversionOperator) { struct Out { int x; - explicit Out(const int x) : x(x) {} + explicit Out(const int val) : x(val) {} explicit Out(const In&) : x(0) {} };