From 7c4ed32c1a240e47b60dba989b3bf862d4d035f5 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Mon, 19 Oct 2020 17:08:56 -0700 Subject: [PATCH 1/2] Enable misc-unused-using-decls --- .clang-tidy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 4d5509f35cb..dd9463a6e82 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -23,7 +23,7 @@ Checks: '-*, misc-unconventional-assign-operator, misc-uniqueptr-reset-release, misc-unused-alias-decls, - -misc-unused-using-decls, + misc-unused-using-decls, modernize-make-unique, -modernize-redundant-void-arg, modernize-replace-auto-ptr, From aae4f4cf185f80bfb37e23d7ccc577710c828c0f Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Mon, 19 Oct 2020 18:12:11 -0700 Subject: [PATCH 2/2] Fix by misc-unused-using-decls --- src/cpp/ext/proto_server_reflection.cc | 1 - test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc | 1 - test/cpp/end2end/async_end2end_test.cc | 1 - test/cpp/end2end/client_crash_test.cc | 1 - test/cpp/end2end/client_lb_end2end_test.cc | 1 - test/cpp/end2end/filter_end2end_test.cc | 1 - test/cpp/end2end/generic_end2end_test.cc | 1 - test/cpp/end2end/mock_test.cc | 2 -- test/cpp/end2end/server_crash_test.cc | 1 - test/cpp/end2end/service_config_end2end_test.cc | 1 - test/cpp/end2end/streaming_throughput_test.cc | 1 - test/cpp/end2end/test_service_impl.h | 2 -- test/cpp/end2end/thread_stress_test.cc | 1 - test/cpp/ext/filters/census/stats_plugin_end2end_test.cc | 1 - test/cpp/interop/interop_server.cc | 1 - test/cpp/interop/metrics_client.cc | 1 - test/cpp/interop/reconnect_interop_server.cc | 5 ----- test/cpp/interop/stress_test.cc | 1 - test/cpp/interop/xds_interop_client.cc | 4 ---- test/cpp/interop/xds_interop_server.cc | 4 ---- test/cpp/naming/resolver_component_test.cc | 1 - test/cpp/qps/driver.cc | 1 - test/cpp/server/load_reporter/load_reporter_test.cc | 3 --- test/cpp/util/channelz_sampler.cc | 4 ---- test/cpp/util/time_test.cc | 1 - 25 files changed, 42 deletions(-) diff --git a/src/cpp/ext/proto_server_reflection.cc b/src/cpp/ext/proto_server_reflection.cc index 3df372f4236..29ecef0de28 100644 --- a/src/cpp/ext/proto_server_reflection.cc +++ b/src/cpp/ext/proto_server_reflection.cc @@ -28,7 +28,6 @@ using grpc::StatusCode; using grpc::reflection::v1alpha::ErrorResponse; using grpc::reflection::v1alpha::ExtensionNumberResponse; using grpc::reflection::v1alpha::ExtensionRequest; -using grpc::reflection::v1alpha::FileDescriptorResponse; using grpc::reflection::v1alpha::ListServiceResponse; using grpc::reflection::v1alpha::ServerReflectionRequest; using grpc::reflection::v1alpha::ServerReflectionResponse; diff --git a/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc b/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc index 236d26723c8..54435b7cdf3 100644 --- a/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc +++ b/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc @@ -66,7 +66,6 @@ using grpc_core::internal::alts_handshaker_client_ref_for_testing; using grpc_core::internal::alts_handshaker_client_set_cb_for_testing; using grpc_core::internal::alts_handshaker_client_set_fields_for_testing; using grpc_core::internal::alts_handshaker_client_set_recv_bytes_for_testing; -using grpc_core::internal::alts_handshaker_client_set_vtable_for_testing; using grpc_core::internal::alts_tsi_handshaker_get_client_for_testing; using grpc_core::internal::alts_tsi_handshaker_get_is_client_for_testing; using grpc_core::internal::alts_tsi_handshaker_set_client_vtable_for_testing; diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 22d5bb56706..91db411fc2c 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -53,7 +53,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using grpc::testing::kTlsCredentialsType; using std::chrono::system_clock; namespace grpc { diff --git a/test/cpp/end2end/client_crash_test.cc b/test/cpp/end2end/client_crash_test.cc index 266c01cff64..5ac8f2ec041 100644 --- a/test/cpp/end2end/client_crash_test.cc +++ b/test/cpp/end2end/client_crash_test.cc @@ -38,7 +38,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using std::chrono::system_clock; static std::string g_root; diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index a13f28c92cf..9c4923e1d62 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -68,7 +68,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using std::chrono::system_clock; // defined in tcp_client.cc extern grpc_tcp_client_vtable* grpc_tcp_client_impl; diff --git a/test/cpp/end2end/filter_end2end_test.cc b/test/cpp/end2end/filter_end2end_test.cc index 687fff3223c..ca435b3d279 100644 --- a/test/cpp/end2end/filter_end2end_test.cc +++ b/test/cpp/end2end/filter_end2end_test.cc @@ -46,7 +46,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using std::chrono::system_clock; namespace grpc { namespace testing { diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 67ce48a95f4..1ca1e470262 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -43,7 +43,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using std::chrono::system_clock; namespace grpc { namespace testing { diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc index a5f8192dbb8..1c684ef51e5 100644 --- a/test/cpp/end2end/mock_test.cc +++ b/test/cpp/end2end/mock_test.cc @@ -48,11 +48,9 @@ using grpc::testing::EchoResponse; using grpc::testing::EchoTestService; using grpc::testing::MockClientReaderWriter; using std::vector; -using std::chrono::system_clock; using ::testing::_; using ::testing::AtLeast; using ::testing::DoAll; -using ::testing::Invoke; using ::testing::Return; using ::testing::SaveArg; using ::testing::SetArgPointee; diff --git a/test/cpp/end2end/server_crash_test.cc b/test/cpp/end2end/server_crash_test.cc index f65dde689a9..b26ddaa1b09 100644 --- a/test/cpp/end2end/server_crash_test.cc +++ b/test/cpp/end2end/server_crash_test.cc @@ -38,7 +38,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using std::chrono::system_clock; static std::string g_root; diff --git a/test/cpp/end2end/service_config_end2end_test.cc b/test/cpp/end2end/service_config_end2end_test.cc index a4d7c09817e..e49704f54dc 100644 --- a/test/cpp/end2end/service_config_end2end_test.cc +++ b/test/cpp/end2end/service_config_end2end_test.cc @@ -65,7 +65,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using std::chrono::system_clock; namespace grpc { namespace testing { diff --git a/test/cpp/end2end/streaming_throughput_test.cc b/test/cpp/end2end/streaming_throughput_test.cc index f2252063fb1..bfc0d1e370c 100644 --- a/test/cpp/end2end/streaming_throughput_test.cc +++ b/test/cpp/end2end/streaming_throughput_test.cc @@ -42,7 +42,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using std::chrono::system_clock; const char* kLargeString = "(" diff --git a/test/cpp/end2end/test_service_impl.h b/test/cpp/end2end/test_service_impl.h index 31432d96b59..c90c0702b6c 100644 --- a/test/cpp/end2end/test_service_impl.h +++ b/test/cpp/end2end/test_service_impl.h @@ -36,8 +36,6 @@ #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "test/cpp/util/string_ref_helper.h" -using std::chrono::system_clock; - namespace grpc { namespace testing { diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc index 01b46e11ff3..1c5a387e9d6 100644 --- a/test/cpp/end2end/thread_stress_test.cc +++ b/test/cpp/end2end/thread_stress_test.cc @@ -42,7 +42,6 @@ using grpc::testing::EchoRequest; using grpc::testing::EchoResponse; -using std::chrono::system_clock; const int kNumThreads = 100; // Number of threads const int kNumAsyncSendThreads = 2; diff --git a/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc index 0e947c6c014..1e71910b276 100644 --- a/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc +++ b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc @@ -45,7 +45,6 @@ using ::opencensus::stats::View; using ::opencensus::stats::ViewDescriptor; using ::opencensus::stats::testing::TestUtils; using ::opencensus::tags::TagKey; -using ::opencensus::tags::TagMap; using ::opencensus::tags::WithTagMap; static const auto TEST_TAG_KEY = TagKey::Register("my_key"); diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index f7e3c8c0e9b..525020d7185 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -51,7 +51,6 @@ using grpc::ServerCredentials; using grpc::ServerReader; using grpc::ServerReaderWriter; using grpc::ServerWriter; -using grpc::SslServerCredentialsOptions; using grpc::Status; using grpc::WriteOptions; using grpc::testing::InteropServerContextInspector; diff --git a/test/cpp/interop/metrics_client.cc b/test/cpp/interop/metrics_client.cc index f2fa1a87b96..b80a32e1d82 100644 --- a/test/cpp/interop/metrics_client.cc +++ b/test/cpp/interop/metrics_client.cc @@ -40,7 +40,6 @@ DEFINE_bool(total_only, false, using grpc::testing::EmptyMessage; using grpc::testing::GaugeResponse; using grpc::testing::MetricsService; -using grpc::testing::MetricsServiceImpl; // Do not log anything void BlackholeLogger(gpr_log_func_args* /*args*/) {} diff --git a/test/cpp/interop/reconnect_interop_server.cc b/test/cpp/interop/reconnect_interop_server.cc index d6b446d7947..188674692e6 100644 --- a/test/cpp/interop/reconnect_interop_server.cc +++ b/test/cpp/interop/reconnect_interop_server.cc @@ -46,11 +46,6 @@ DEFINE_int32(retry_port, 0, using grpc::Server; using grpc::ServerBuilder; using grpc::ServerContext; -using grpc::ServerCredentials; -using grpc::ServerReader; -using grpc::ServerReaderWriter; -using grpc::ServerWriter; -using grpc::SslServerCredentialsOptions; using grpc::Status; using grpc::testing::Empty; using grpc::testing::ReconnectInfo; diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc index 071b0e27da9..f04f8ac3783 100644 --- a/test/cpp/interop/stress_test.cc +++ b/test/cpp/interop/stress_test.cc @@ -109,7 +109,6 @@ DEFINE_string(server_host_override, "", using grpc::testing::ALTS; using grpc::testing::INSECURE; using grpc::testing::kTestCaseList; -using grpc::testing::MetricsService; using grpc::testing::MetricsServiceImpl; using grpc::testing::StressTestInteropClient; using grpc::testing::TestCaseType; diff --git a/test/cpp/interop/xds_interop_client.cc b/test/cpp/interop/xds_interop_client.cc index 92d3ac9da5a..0e8144d6ba9 100644 --- a/test/cpp/interop/xds_interop_client.cc +++ b/test/cpp/interop/xds_interop_client.cc @@ -61,10 +61,6 @@ using grpc::CompletionQueue; using grpc::Server; using grpc::ServerBuilder; using grpc::ServerContext; -using grpc::ServerCredentials; -using grpc::ServerReader; -using grpc::ServerReaderWriter; -using grpc::ServerWriter; using grpc::Status; using grpc::testing::Empty; using grpc::testing::LoadBalancerStatsRequest; diff --git a/test/cpp/interop/xds_interop_server.cc b/test/cpp/interop/xds_interop_server.cc index 8e6f9bb5e3f..dcc5a7db6ea 100644 --- a/test/cpp/interop/xds_interop_server.cc +++ b/test/cpp/interop/xds_interop_server.cc @@ -41,10 +41,6 @@ DEFINE_string(server_id, "cpp_server", "Server ID to include in responses."); using grpc::Server; using grpc::ServerBuilder; using grpc::ServerContext; -using grpc::ServerCredentials; -using grpc::ServerReader; -using grpc::ServerReaderWriter; -using grpc::ServerWriter; using grpc::Status; using grpc::testing::Empty; using grpc::testing::SimpleRequest; diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc index 09a7454a0cc..c1ae008c7eb 100644 --- a/test/cpp/naming/resolver_component_test.cc +++ b/test/cpp/naming/resolver_component_test.cc @@ -79,7 +79,6 @@ #define BAD_SOCKET_RETURN_VAL (-1) #endif -using grpc::SubProcess; using std::vector; using testing::UnorderedElementsAreArray; diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 35fd7926e61..757ad7ce721 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -45,7 +45,6 @@ using std::deque; using std::list; -using std::thread; using std::unique_ptr; using std::vector; diff --git a/test/cpp/server/load_reporter/load_reporter_test.cc b/test/cpp/server/load_reporter/load_reporter_test.cc index 847052addbf..614a03bf0b3 100644 --- a/test/cpp/server/load_reporter/load_reporter_test.cc +++ b/test/cpp/server/load_reporter/load_reporter_test.cc @@ -44,9 +44,6 @@ using ::grpc::lb::v1::LoadBalancingFeedback; using ::grpc::load_reporter::CensusViewProvider; using ::grpc::load_reporter::CpuStatsProvider; using ::grpc::load_reporter::LoadReporter; -using ::opencensus::stats::View; -using ::opencensus::stats::ViewData; -using ::opencensus::stats::ViewDataImpl; using ::opencensus::stats::ViewDescriptor; using ::testing::DoubleNear; using ::testing::Return; diff --git a/test/cpp/util/channelz_sampler.cc b/test/cpp/util/channelz_sampler.cc index 8a30c89fcc4..faae640636d 100644 --- a/test/cpp/util/channelz_sampler.cc +++ b/test/cpp/util/channelz_sampler.cc @@ -60,10 +60,6 @@ using grpc::Status; using grpc::StatusCode; using grpc::channelz::v1::GetChannelRequest; using grpc::channelz::v1::GetChannelResponse; -using grpc::channelz::v1::GetServerRequest; -using grpc::channelz::v1::GetServerResponse; -using grpc::channelz::v1::GetServerSocketsRequest; -using grpc::channelz::v1::GetServerSocketsResponse; using grpc::channelz::v1::GetServersRequest; using grpc::channelz::v1::GetServersResponse; using grpc::channelz::v1::GetSocketRequest; diff --git a/test/cpp/util/time_test.cc b/test/cpp/util/time_test.cc index bcbfa14f94f..a64bec7f7e3 100644 --- a/test/cpp/util/time_test.cc +++ b/test/cpp/util/time_test.cc @@ -22,7 +22,6 @@ #include "test/core/util/test_config.h" -using std::chrono::duration_cast; using std::chrono::microseconds; using std::chrono::system_clock;