diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 7292184bf71..fec5fd952fb 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -209,7 +209,7 @@ class ChannelData { grpc_closure* on_complete, grpc_closure* watcher_timer_init); - ~ExternalConnectivityWatcher(); + ~ExternalConnectivityWatcher() override; // Removes the watcher from the external_watchers_ map. static void RemoveWatcherFromExternalWatchersMap(ChannelData* chand, @@ -919,7 +919,7 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { chand_->subchannel_wrappers_.insert(this); } - ~SubchannelWrapper() { + ~SubchannelWrapper() override { if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) { gpr_log(GPR_INFO, "chand=%p: destroying subchannel wrapper %p for subchannel %p", @@ -1062,7 +1062,7 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface { parent_(std::move(parent)), last_seen_state_(initial_state) {} - ~WatcherWrapper() { + ~WatcherWrapper() override { auto* parent = parent_.release(); // ref owned by lambda parent->chand_->work_serializer_->Run( [parent]() { parent->Unref(DEBUG_LOCATION, "WatcherWrapper"); }, diff --git a/src/core/ext/filters/client_channel/config_selector.h b/src/core/ext/filters/client_channel/config_selector.h index 17c14daa4ae..54e6bd5d0c6 100644 --- a/src/core/ext/filters/client_channel/config_selector.h +++ b/src/core/ext/filters/client_channel/config_selector.h @@ -65,7 +65,7 @@ class ConfigSelector : public RefCounted { std::function on_call_committed; }; - virtual ~ConfigSelector() = default; + ~ConfigSelector() override = default; virtual const char* name() const = 0; diff --git a/src/core/ext/filters/client_channel/health/health_check_client.h b/src/core/ext/filters/client_channel/health/health_check_client.h index e9555b5f955..24b59c7c5f4 100644 --- a/src/core/ext/filters/client_channel/health/health_check_client.h +++ b/src/core/ext/filters/client_channel/health/health_check_client.h @@ -50,7 +50,7 @@ class HealthCheckClient : public InternallyRefCounted { RefCountedPtr channelz_node, RefCountedPtr watcher); - ~HealthCheckClient(); + ~HealthCheckClient() override; void Orphan() override; @@ -60,7 +60,7 @@ class HealthCheckClient : public InternallyRefCounted { public: CallState(RefCountedPtr health_check_client, grpc_pollset_set* interested_parties_); - ~CallState(); + ~CallState() override; void Orphan() override; diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/src/core/ext/filters/client_channel/http_connect_handshaker.cc index 620cc89e334..1b9817cee78 100644 --- a/src/core/ext/filters/client_channel/http_connect_handshaker.cc +++ b/src/core/ext/filters/client_channel/http_connect_handshaker.cc @@ -54,7 +54,7 @@ class HttpConnectHandshaker : public Handshaker { const char* name() const override { return "http_connect"; } private: - virtual ~HttpConnectHandshaker(); + ~HttpConnectHandshaker() override; void CleanupArgsForFailureLocked(); void HandshakeFailedLocked(grpc_error* error); static void OnWriteDone(void* arg, grpc_error* error); diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h index e132564bc38..13c315e0bf5 100644 --- a/src/core/ext/filters/client_channel/lb_policy.h +++ b/src/core/ext/filters/client_channel/lb_policy.h @@ -301,7 +301,7 @@ class LoadBalancingPolicy : public InternallyRefCounted { /// return the parameters they need. class Config : public RefCounted { public: - virtual ~Config() = default; + ~Config() override = default; // Returns the load balancing policy name virtual const char* name() const = 0; @@ -341,7 +341,7 @@ class LoadBalancingPolicy : public InternallyRefCounted { }; explicit LoadBalancingPolicy(Args args, intptr_t initial_refcount = 1); - virtual ~LoadBalancingPolicy(); + ~LoadBalancingPolicy() override; // Not copyable nor movable. LoadBalancingPolicy(const LoadBalancingPolicy&) = delete; @@ -376,7 +376,7 @@ class LoadBalancingPolicy : public InternallyRefCounted { explicit QueuePicker(RefCountedPtr parent) : parent_(std::move(parent)) {} - ~QueuePicker() { parent_.reset(DEBUG_LOCATION, "QueuePicker"); } + ~QueuePicker() override { parent_.reset(DEBUG_LOCATION, "QueuePicker"); } PickResult Pick(PickArgs args) override; diff --git a/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc b/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc index 2ca1573af6a..0edf61db1bb 100644 --- a/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +++ b/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc @@ -36,7 +36,7 @@ class ChildPolicyHandler::Helper explicit Helper(RefCountedPtr parent) : parent_(std::move(parent)) {} - ~Helper() { parent_.reset(DEBUG_LOCATION, "Helper"); } + ~Helper() override { parent_.reset(DEBUG_LOCATION, "Helper"); } RefCountedPtr CreateSubchannel( ServerAddress address, const grpc_channel_args& args) override { diff --git a/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h b/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h index d67f3264a87..c902c0ec8d6 100644 --- a/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +++ b/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h @@ -36,7 +36,7 @@ class ChildPolicyHandler : public LoadBalancingPolicy { ChildPolicyHandler(Args args, TraceFlag* tracer) : LoadBalancingPolicy(std::move(args)), tracer_(tracer) {} - virtual const char* name() const override { return "child_policy_handler"; } + const char* name() const override { return "child_policy_handler"; } void UpdateLocked(UpdateArgs args) override; void ExitIdleLocked() override; diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index c9f1d4db9f7..3ef86206751 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -164,7 +164,7 @@ class GrpcLb : public LoadBalancingPolicy { public: explicit BalancerCallState( RefCountedPtr parent_grpclb_policy); - ~BalancerCallState(); + ~BalancerCallState() override; // It's the caller's responsibility to ensure that Orphan() is called from // inside the combiner. @@ -369,7 +369,7 @@ class GrpcLb : public LoadBalancingPolicy { : AsyncConnectivityStateWatcherInterface(parent->work_serializer()), parent_(std::move(parent)) {} - ~StateWatcher() { parent_.reset(DEBUG_LOCATION, "StateWatcher"); } + ~StateWatcher() override { parent_.reset(DEBUG_LOCATION, "StateWatcher"); } private: void OnConnectivityStateChange(grpc_connectivity_state new_state, @@ -395,7 +395,7 @@ class GrpcLb : public LoadBalancingPolicy { RefCountedPtr parent_; }; - ~GrpcLb(); + ~GrpcLb() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 784e964960f..8b64f2b4e37 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -55,7 +55,7 @@ class PickFirst : public LoadBalancingPolicy { void ResetBackoffLocked() override; private: - ~PickFirst(); + ~PickFirst() override; class PickFirstSubchannelList; @@ -94,7 +94,7 @@ class PickFirst : public LoadBalancingPolicy { policy->Ref(DEBUG_LOCATION, "subchannel_list").release(); } - ~PickFirstSubchannelList() { + ~PickFirstSubchannelList() override { PickFirst* p = static_cast(policy()); p->Unref(DEBUG_LOCATION, "subchannel_list"); } diff --git a/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc b/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc index 07a7b2700cb..95df80b1caf 100644 --- a/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +++ b/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc @@ -93,7 +93,7 @@ class PriorityLb : public LoadBalancingPolicy { public: ChildPriority(RefCountedPtr priority_policy, std::string name); - ~ChildPriority() { + ~ChildPriority() override { priority_policy_.reset(DEBUG_LOCATION, "ChildPriority"); } @@ -152,7 +152,7 @@ class PriorityLb : public LoadBalancingPolicy { explicit Helper(RefCountedPtr priority) : priority_(std::move(priority)) {} - ~Helper() { priority_.reset(DEBUG_LOCATION, "Helper"); } + ~Helper() override { priority_.reset(DEBUG_LOCATION, "Helper"); } RefCountedPtr CreateSubchannel( ServerAddress address, const grpc_channel_args& args) override; @@ -202,7 +202,7 @@ class PriorityLb : public LoadBalancingPolicy { bool failover_timer_callback_pending_ = false; }; - ~PriorityLb(); + ~PriorityLb() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index 6dc107702e3..efc7942a6a0 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -65,7 +65,7 @@ class RoundRobin : public LoadBalancingPolicy { void ResetBackoffLocked() override; private: - ~RoundRobin(); + ~RoundRobin() override; // Forward declaration. class RoundRobinSubchannelList; @@ -122,7 +122,7 @@ class RoundRobin : public LoadBalancingPolicy { policy->Ref(DEBUG_LOCATION, "subchannel_list").release(); } - ~RoundRobinSubchannelList() { + ~RoundRobinSubchannelList() override { RoundRobin* p = static_cast(policy()); p->Unref(DEBUG_LOCATION, "subchannel_list"); } diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 56ff2ab6364..a240a2d0e17 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -142,7 +142,9 @@ class SubchannelData { : subchannel_data_(subchannel_data), subchannel_list_(std::move(subchannel_list)) {} - ~Watcher() { subchannel_list_.reset(DEBUG_LOCATION, "Watcher dtor"); } + ~Watcher() override { + subchannel_list_.reset(DEBUG_LOCATION, "Watcher dtor"); + } void OnConnectivityStateChange(grpc_connectivity_state new_state) override; diff --git a/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc b/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc index 0f99692da5c..1eca478b488 100644 --- a/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +++ b/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc @@ -118,7 +118,7 @@ class WeightedTargetLb : public LoadBalancingPolicy { public: WeightedChild(RefCountedPtr weighted_target_policy, const std::string& name); - ~WeightedChild(); + ~WeightedChild() override; void Orphan() override; @@ -142,7 +142,7 @@ class WeightedTargetLb : public LoadBalancingPolicy { explicit Helper(RefCountedPtr weighted_child) : weighted_child_(std::move(weighted_child)) {} - ~Helper() { weighted_child_.reset(DEBUG_LOCATION, "Helper"); } + ~Helper() override { weighted_child_.reset(DEBUG_LOCATION, "Helper"); } RefCountedPtr CreateSubchannel( ServerAddress address, const grpc_channel_args& args) override; @@ -188,7 +188,7 @@ class WeightedTargetLb : public LoadBalancingPolicy { bool shutdown_ = false; }; - ~WeightedTargetLb(); + ~WeightedTargetLb() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc b/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc index da048b553d1..bb336d7df21 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc @@ -113,7 +113,7 @@ class CdsLb : public LoadBalancingPolicy { RefCountedPtr parent_; }; - ~CdsLb(); + ~CdsLb() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc b/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc index 3eeac4ef63e..5d7946c0b36 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc @@ -144,7 +144,7 @@ class EdsLb : public LoadBalancingPolicy { explicit Helper(RefCountedPtr eds_policy) : eds_policy_(std::move(eds_policy)) {} - ~Helper() { eds_policy_.reset(DEBUG_LOCATION, "Helper"); } + ~Helper() override { eds_policy_.reset(DEBUG_LOCATION, "Helper"); } RefCountedPtr CreateSubchannel( ServerAddress address, const grpc_channel_args& args) override; @@ -160,7 +160,7 @@ class EdsLb : public LoadBalancingPolicy { RefCountedPtr eds_policy_; }; - ~EdsLb(); + ~EdsLb() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc index 506d4623f97..ad2f61cffb0 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc @@ -141,7 +141,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy { Picker(RefCountedPtr xds_cluster_impl_lb, RefCountedPtr picker); - PickResult Pick(PickArgs args); + PickResult Pick(PickArgs args) override; private: RefCountedPtr xds_cluster_impl_lb_; @@ -157,7 +157,9 @@ class XdsClusterImplLb : public LoadBalancingPolicy { explicit Helper(RefCountedPtr xds_cluster_impl_policy) : xds_cluster_impl_policy_(std::move(xds_cluster_impl_policy)) {} - ~Helper() { xds_cluster_impl_policy_.reset(DEBUG_LOCATION, "Helper"); } + ~Helper() override { + xds_cluster_impl_policy_.reset(DEBUG_LOCATION, "Helper"); + } RefCountedPtr CreateSubchannel( ServerAddress address, const grpc_channel_args& args) override; @@ -171,7 +173,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy { RefCountedPtr xds_cluster_impl_policy_; }; - ~XdsClusterImplLb(); + ~XdsClusterImplLb() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc index 4363c86c10b..d4d3fb7c517 100644 --- a/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +++ b/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc @@ -117,7 +117,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy { public: ClusterChild(RefCountedPtr xds_cluster_manager_policy, const std::string& name); - ~ClusterChild(); + ~ClusterChild() override; void Orphan() override; @@ -141,7 +141,9 @@ class XdsClusterManagerLb : public LoadBalancingPolicy { explicit Helper(RefCountedPtr xds_cluster_manager_child) : xds_cluster_manager_child_(std::move(xds_cluster_manager_child)) {} - ~Helper() { xds_cluster_manager_child_.reset(DEBUG_LOCATION, "Helper"); } + ~Helper() override { + xds_cluster_manager_child_.reset(DEBUG_LOCATION, "Helper"); + } RefCountedPtr CreateSubchannel( ServerAddress address, const grpc_channel_args& args) override; @@ -182,7 +184,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy { bool shutdown_ = false; }; - ~XdsClusterManagerLb(); + ~XdsClusterManagerLb() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h index de941a063b4..6c0a8efd9d9 100644 --- a/src/core/ext/filters/client_channel/resolver.h +++ b/src/core/ext/filters/client_channel/resolver.h @@ -87,7 +87,7 @@ class Resolver : public InternallyRefCounted { // Not copyable nor movable. Resolver(const Resolver&) = delete; Resolver& operator=(const Resolver&) = delete; - virtual ~Resolver() = default; + ~Resolver() override = default; /// Starts resolving. virtual void StartLocked() = 0; diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc index c5439717c09..f0bf0cda2fe 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -75,7 +75,7 @@ class AresDnsResolver : public Resolver { void ShutdownLocked() override; private: - virtual ~AresDnsResolver(); + ~AresDnsResolver() override; void MaybeStartResolvingLocked(); void StartResolvingLocked(); diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc index 6659dc157b1..062f4830e31 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc @@ -49,7 +49,7 @@ class GrpcPolledFdPosix : public GrpcPolledFd { grpc_pollset_set_add_fd(driver_pollset_set_, fd_); } - ~GrpcPolledFdPosix() { + ~GrpcPolledFdPosix() override { grpc_pollset_set_del_fd(driver_pollset_set_, fd_); /* c-ares library will close the fd inside grpc_fd. This fd may be picked up immediately by another thread, and should not be closed by the following diff --git a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc index 3b0c042d292..e17d84f414d 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc @@ -63,7 +63,7 @@ class NativeDnsResolver : public Resolver { void ShutdownLocked() override; private: - virtual ~NativeDnsResolver(); + ~NativeDnsResolver() override; void MaybeStartResolvingLocked(); void StartResolvingLocked(); diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc index 0bfb651a0f5..005de558ad7 100644 --- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc @@ -59,7 +59,7 @@ class FakeResolver : public Resolver { friend class FakeResolverResponseGenerator; friend class FakeResolverResponseSetter; - virtual ~FakeResolver(); + ~FakeResolver() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h index b9fd90c069f..b9ca69df1e0 100644 --- a/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +++ b/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h @@ -43,7 +43,7 @@ class FakeResolverResponseGenerator : public RefCounted { public: FakeResolverResponseGenerator(); - ~FakeResolverResponseGenerator(); + ~FakeResolverResponseGenerator() override; // Instructs the fake resolver associated with the response generator // instance to trigger a new resolution with the specified result. If the diff --git a/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc b/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc index e8a7717d45a..af957f74993 100644 --- a/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc @@ -140,7 +140,7 @@ class XdsResolver : public Resolver { XdsConfigSelector(RefCountedPtr resolver, const std::vector& routes, grpc_error* error); - ~XdsConfigSelector(); + ~XdsConfigSelector() override; const char* name() const override { return "XdsConfigSelector"; } diff --git a/src/core/ext/filters/client_channel/resolving_lb_policy.cc b/src/core/ext/filters/client_channel/resolving_lb_policy.cc index 49512c5d5ab..889c20ca85c 100644 --- a/src/core/ext/filters/client_channel/resolving_lb_policy.cc +++ b/src/core/ext/filters/client_channel/resolving_lb_policy.cc @@ -78,7 +78,7 @@ class ResolvingLoadBalancingPolicy::ResolverResultHandler RefCountedPtr parent) : parent_(std::move(parent)) {} - ~ResolverResultHandler() { + ~ResolverResultHandler() override { if (GRPC_TRACE_FLAG_ENABLED(*(parent_->tracer_))) { gpr_log(GPR_INFO, "resolving_lb=%p: resolver shutdown complete", parent_.get()); diff --git a/src/core/ext/filters/client_channel/resolving_lb_policy.h b/src/core/ext/filters/client_channel/resolving_lb_policy.h index 2835c84d707..dd592be0faa 100644 --- a/src/core/ext/filters/client_channel/resolving_lb_policy.h +++ b/src/core/ext/filters/client_channel/resolving_lb_policy.h @@ -83,7 +83,7 @@ class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy { grpc_core::UniquePtr target_uri, ChannelConfigHelper* helper); - virtual const char* name() const override { return "resolving_lb"; } + const char* name() const override { return "resolving_lb"; } // No-op -- should never get updates from the channel. // TODO(roth): Need to support updating child LB policy's config for xds @@ -100,7 +100,7 @@ class ResolvingLoadBalancingPolicy : public LoadBalancingPolicy { class ResolverResultHandler; class ResolvingControlHelper; - ~ResolvingLoadBalancingPolicy(); + ~ResolvingLoadBalancingPolicy() override; void ShutdownLocked() override; diff --git a/src/core/ext/filters/client_channel/retry_throttle.h b/src/core/ext/filters/client_channel/retry_throttle.h index 897a617f59a..e40363fd3d1 100644 --- a/src/core/ext/filters/client_channel/retry_throttle.h +++ b/src/core/ext/filters/client_channel/retry_throttle.h @@ -32,7 +32,7 @@ class ServerRetryThrottleData : public RefCounted { public: ServerRetryThrottleData(intptr_t max_milli_tokens, intptr_t milli_token_ratio, ServerRetryThrottleData* old_throttle_data); - ~ServerRetryThrottleData(); + ~ServerRetryThrottleData() override; /// Records a failure. Returns true if it's okay to send a retry. bool RecordFailure(); diff --git a/src/core/ext/filters/client_channel/service_config.h b/src/core/ext/filters/client_channel/service_config.h index 6086a4d5203..2dfd45d8f6c 100644 --- a/src/core/ext/filters/client_channel/service_config.h +++ b/src/core/ext/filters/client_channel/service_config.h @@ -71,7 +71,7 @@ class ServiceConfig : public RefCounted { ServiceConfig(const grpc_channel_args* args, std::string json_string, Json json, grpc_error** error); - ~ServiceConfig(); + ~ServiceConfig() override; const std::string& json_string() const { return json_string_; } diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc index 561472d1da0..286a50e9338 100644 --- a/src/core/ext/filters/client_channel/subchannel.cc +++ b/src/core/ext/filters/client_channel/subchannel.cc @@ -325,7 +325,7 @@ class Subchannel::ConnectedSubchannelStateWatcher GRPC_SUBCHANNEL_WEAK_UNREF(subchannel_, "connecting"); } - ~ConnectedSubchannelStateWatcher() { + ~ConnectedSubchannelStateWatcher() override { GRPC_SUBCHANNEL_WEAK_UNREF(subchannel_, "state_watcher"); } @@ -452,7 +452,7 @@ class Subchannel::HealthWatcherMap::HealthWatcher if (subchannel_state == GRPC_CHANNEL_READY) StartHealthCheckingLocked(); } - ~HealthWatcher() { + ~HealthWatcher() override { GRPC_SUBCHANNEL_WEAK_UNREF(subchannel_, "health_watcher"); } diff --git a/src/core/ext/filters/client_channel/subchannel.h b/src/core/ext/filters/client_channel/subchannel.h index f3de5c80747..46ffb2f25b3 100644 --- a/src/core/ext/filters/client_channel/subchannel.h +++ b/src/core/ext/filters/client_channel/subchannel.h @@ -76,7 +76,7 @@ class ConnectedSubchannel : public RefCounted { ConnectedSubchannel( grpc_channel_stack* channel_stack, const grpc_channel_args* args, RefCountedPtr channelz_subchannel); - ~ConnectedSubchannel(); + ~ConnectedSubchannel() override; void StartWatch(grpc_pollset_set* interested_parties, OrphanablePtr watcher); @@ -186,7 +186,7 @@ class Subchannel { RefCountedPtr connected_subchannel; }; - virtual ~ConnectivityStateWatcherInterface() = default; + ~ConnectivityStateWatcherInterface() override = default; // Will be invoked whenever the subchannel's connectivity state // changes. There will be only one invocation of this method on a diff --git a/src/core/ext/filters/client_channel/subchannel_interface.h b/src/core/ext/filters/client_channel/subchannel_interface.h index d3a11cb301f..c1618470a2f 100644 --- a/src/core/ext/filters/client_channel/subchannel_interface.h +++ b/src/core/ext/filters/client_channel/subchannel_interface.h @@ -50,7 +50,7 @@ class SubchannelInterface : public RefCounted { explicit SubchannelInterface(const char* trace = nullptr) : RefCounted(trace) {} - virtual ~SubchannelInterface() = default; + ~SubchannelInterface() override = default; // Returns the current connectivity state of the subchannel. virtual grpc_connectivity_state CheckConnectivityState() = 0; diff --git a/src/core/ext/filters/client_channel/subchannel_pool_interface.h b/src/core/ext/filters/client_channel/subchannel_pool_interface.h index 9c48f61d399..f320ab69c26 100644 --- a/src/core/ext/filters/client_channel/subchannel_pool_interface.h +++ b/src/core/ext/filters/client_channel/subchannel_pool_interface.h @@ -67,7 +67,7 @@ class SubchannelPoolInterface : public RefCounted { : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_subchannel_pool_trace) ? "SubchannelPoolInterface" : nullptr) {} - virtual ~SubchannelPoolInterface() {} + ~SubchannelPoolInterface() override {} // Registers a subchannel against a key. Returns the subchannel registered // with \a key, which may be different from \a constructed because we reuse diff --git a/src/core/ext/filters/max_age/max_age_filter.cc b/src/core/ext/filters/max_age/max_age_filter.cc index ef59d675770..b417db51caa 100644 --- a/src/core/ext/filters/max_age/max_age_filter.cc +++ b/src/core/ext/filters/max_age/max_age_filter.cc @@ -224,7 +224,7 @@ class ConnectivityWatcher : public AsyncConnectivityStateWatcherInterface { GRPC_CHANNEL_STACK_REF(chand_->channel_stack, "max_age conn_watch"); } - ~ConnectivityWatcher() { + ~ConnectivityWatcher() override { GRPC_CHANNEL_STACK_UNREF(chand_->channel_stack, "max_age conn_watch"); } diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.h b/src/core/ext/transport/chttp2/client/chttp2_connector.h index 37143c8f187..7624b7f8f7e 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.h +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.h @@ -30,7 +30,7 @@ namespace grpc_core { class Chttp2Connector : public SubchannelConnector { public: Chttp2Connector(); - ~Chttp2Connector(); + ~Chttp2Connector() override; void Connect(const Args& args, Result* result, grpc_closure* notify) override; void Shutdown(grpc_error* error) override; diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 000c63c8786..4c63dd7f589 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -63,7 +63,7 @@ class Chttp2ServerListener : public Server::ListenerInterface { // Do not instantiate directly. Use one of the factory methods above. Chttp2ServerListener(Server* server, grpc_channel_args* args); - ~Chttp2ServerListener(); + ~Chttp2ServerListener() override; void Start(Server* server, const std::vector* pollsets) override; @@ -85,7 +85,7 @@ class Chttp2ServerListener : public Server::ListenerInterface { RefCountedPtr handshake_mgr, grpc_channel_args* args, grpc_endpoint* endpoint); - ~ConnectionState(); + ~ConnectionState() override; private: static void OnTimeout(void* arg, grpc_error* error); diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h index a55ab82efb4..42c5986fd93 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.h +++ b/src/core/ext/transport/chttp2/transport/flow_control.h @@ -221,7 +221,7 @@ class TransportFlowControlDisabled final : public TransportFlowControlBase { class TransportFlowControl final : public TransportFlowControlBase { public: TransportFlowControl(const grpc_chttp2_transport* t, bool enable_bdp_probe); - ~TransportFlowControl() {} + ~TransportFlowControl() override {} bool flow_control_enabled() const override { return true; } @@ -409,7 +409,7 @@ class StreamFlowControlDisabled : public StreamFlowControlBase { class StreamFlowControl final : public StreamFlowControlBase { public: StreamFlowControl(TransportFlowControl* tfc, const grpc_chttp2_stream* s); - ~StreamFlowControl() { + ~StreamFlowControl() override { tfc_->PreUpdateAnnouncedWindowOverIncomingWindow(announced_window_delta_); } diff --git a/src/core/ext/xds/xds_client.h b/src/core/ext/xds/xds_client.h index 9e222fbb536..eaa03da0a5e 100644 --- a/src/core/ext/xds/xds_client.h +++ b/src/core/ext/xds/xds_client.h @@ -86,7 +86,7 @@ class XdsClient : public DualRefCounted { // Callers should not instantiate directly. Use GetOrCreate() instead. explicit XdsClient(grpc_error** error); - ~XdsClient(); + ~XdsClient() override; grpc_pollset_set* interested_parties() const { return interested_parties_; } @@ -199,7 +199,7 @@ class XdsClient : public DualRefCounted { ChannelState(WeakRefCountedPtr xds_client, grpc_channel* channel); - ~ChannelState(); + ~ChannelState() override; void Orphan() override; diff --git a/src/core/ext/xds/xds_client_stats.h b/src/core/ext/xds/xds_client_stats.h index 1906f08db2d..523ef111efc 100644 --- a/src/core/ext/xds/xds_client_stats.h +++ b/src/core/ext/xds/xds_client_stats.h @@ -131,7 +131,7 @@ class XdsClusterDropStats : public RefCounted { absl::string_view lrs_server_name, absl::string_view cluster_name, absl::string_view eds_service_name); - ~XdsClusterDropStats(); + ~XdsClusterDropStats() override; // Returns a snapshot of this instance and resets all the counters. Snapshot GetSnapshotAndReset(); @@ -206,7 +206,7 @@ class XdsClusterLocalityStats : public RefCounted { absl::string_view cluster_name, absl::string_view eds_service_name, RefCountedPtr name); - ~XdsClusterLocalityStats(); + ~XdsClusterLocalityStats() override; // Returns a snapshot of this instance and resets all the counters. Snapshot GetSnapshotAndReset(); diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h index d11a3227727..f39ad49d64e 100644 --- a/src/core/lib/channel/channelz.h +++ b/src/core/lib/channel/channelz.h @@ -87,7 +87,7 @@ class BaseNode : public RefCounted { BaseNode(EntityType type, std::string name); public: - virtual ~BaseNode(); + ~BaseNode() override; // All children must implement this function. virtual Json RenderJson() = 0; diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h index 10b0631968f..541f38ed9dd 100644 --- a/src/core/lib/channel/handshaker.h +++ b/src/core/lib/channel/handshaker.h @@ -77,7 +77,7 @@ struct HandshakerArgs { class Handshaker : public RefCounted { public: - virtual ~Handshaker() = default; + ~Handshaker() override = default; virtual void Shutdown(grpc_error* why) = 0; virtual void DoHandshake(grpc_tcp_server_acceptor* acceptor, grpc_closure* on_handshake_done, @@ -92,7 +92,7 @@ class Handshaker : public RefCounted { class HandshakeManager : public RefCounted { public: HandshakeManager(); - ~HandshakeManager(); + ~HandshakeManager() override; /// Add \a mgr to the server side list of all pending handshake managers, the /// list starts with \a *head. diff --git a/src/core/lib/gprpp/dual_ref_counted.h b/src/core/lib/gprpp/dual_ref_counted.h index 25d8625bf64..91469eaf051 100644 --- a/src/core/lib/gprpp/dual_ref_counted.h +++ b/src/core/lib/gprpp/dual_ref_counted.h @@ -51,7 +51,7 @@ namespace grpc_core { template class DualRefCounted : public Orphanable { public: - virtual ~DualRefCounted() = default; + ~DualRefCounted() override = default; RefCountedPtr Ref() GRPC_MUST_USE_RESULT { IncrementRefCount(); diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h index 4336538ac0b..2a95b9df13b 100644 --- a/src/core/lib/gprpp/orphanable.h +++ b/src/core/lib/gprpp/orphanable.h @@ -88,7 +88,7 @@ class InternallyRefCounted : public Orphanable { explicit InternallyRefCounted(const char* trace = nullptr, intptr_t initial_refcount = 1) : refs_(initial_refcount, trace) {} - virtual ~InternallyRefCounted() = default; + ~InternallyRefCounted() override = default; RefCountedPtr Ref() GRPC_MUST_USE_RESULT { IncrementRefCount(); diff --git a/src/core/lib/iomgr/executor/mpmcqueue.h b/src/core/lib/iomgr/executor/mpmcqueue.h index 474f40bbf87..2af56903bc8 100644 --- a/src/core/lib/iomgr/executor/mpmcqueue.h +++ b/src/core/lib/iomgr/executor/mpmcqueue.h @@ -55,22 +55,22 @@ class InfLenFIFOQueue : public MPMCQueueInterface { // Releases all resources held by the queue. The queue must be empty, and no // one waits on conditional variables. - ~InfLenFIFOQueue(); + ~InfLenFIFOQueue() override; // Puts elem into queue immediately at the end of queue. Since the queue has // infinite length, this routine will never block and should never fail. - void Put(void* elem); + void Put(void* elem) override; // Removes the oldest element from the queue and returns it. // This routine will cause the thread to block if queue is currently empty. // Argument wait_time should be passed in when trace flag turning on (for // collecting stats info purpose.) - void* Get(gpr_timespec* wait_time = nullptr); + void* Get(gpr_timespec* wait_time = nullptr) override; // Returns number of elements in queue currently. // There might be concurrently add/remove on queue, so count might change // quickly. - int count() const { return count_.Load(MemoryOrder::RELAXED); } + int count() const override { return count_.Load(MemoryOrder::RELAXED); } struct Node { Node* next; // Linking diff --git a/src/core/lib/security/certificate_provider.h b/src/core/lib/security/certificate_provider.h index 5a9cfee0b94..81f68f8e669 100644 --- a/src/core/lib/security/certificate_provider.h +++ b/src/core/lib/security/certificate_provider.h @@ -44,7 +44,7 @@ struct grpc_tls_certificate_provider grpc_tls_certificate_provider() : interested_parties_(grpc_pollset_set_create()) {} - virtual ~grpc_tls_certificate_provider() { + ~grpc_tls_certificate_provider() override { grpc_pollset_set_destroy(interested_parties_); } diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h index 1cc6e2d65f5..61e56e58144 100644 --- a/src/core/lib/security/credentials/credentials.h +++ b/src/core/lib/security/credentials/credentials.h @@ -102,7 +102,7 @@ struct grpc_channel_credentials : grpc_core::RefCounted { public: explicit grpc_channel_credentials(const char* type) : type_(type) {} - virtual ~grpc_channel_credentials() = default; + ~grpc_channel_credentials() override = default; // Creates a security connector for the channel. May also create new channel // args for the channel to be used in place of the passed in const args if @@ -177,7 +177,7 @@ struct grpc_call_credentials grpc_security_level min_security_level = GRPC_PRIVACY_AND_INTEGRITY) : type_(type), min_security_level_(min_security_level) {} - virtual ~grpc_call_credentials() = default; + ~grpc_call_credentials() override = default; // Returns true if completed synchronously, in which case \a error will // be set to indicate the result. Otherwise, \a on_request_metadata will @@ -225,7 +225,7 @@ struct grpc_server_credentials public: explicit grpc_server_credentials(const char* type) : type_(type) {} - virtual ~grpc_server_credentials() { DestroyProcessor(); } + ~grpc_server_credentials() override { DestroyProcessor(); } virtual grpc_core::RefCountedPtr create_security_connector() = 0; diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h index fcbff78e235..ccda9784fdd 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h @@ -96,7 +96,7 @@ struct grpc_tls_credential_reload_config void (*cancel)(void* config_user_data, grpc_tls_credential_reload_arg* arg), void (*destruct)(void* config_user_data)); - ~grpc_tls_credential_reload_config(); + ~grpc_tls_credential_reload_config() override; void* context() const { return context_; } void set_context(void* context) { context_ = context; } @@ -172,7 +172,7 @@ struct grpc_tls_server_authorization_check_config void (*cancel)(void* config_user_data, grpc_tls_server_authorization_check_arg* arg), void (*destruct)(void* config_user_data)); - ~grpc_tls_server_authorization_check_config(); + ~grpc_tls_server_authorization_check_config() override; void* context() const { return context_; } void set_context(void* context) { context_ = context; } @@ -245,7 +245,7 @@ struct grpc_tls_server_authorization_check_config struct grpc_tls_credentials_options : public grpc_core::RefCounted { public: - ~grpc_tls_credentials_options() { + ~grpc_tls_credentials_options() override { if (key_materials_config_.get() != nullptr) { key_materials_config_.get()->Unref(); } diff --git a/src/core/lib/security/security_connector/security_connector.h b/src/core/lib/security/security_connector/security_connector.h index c3e264f30f9..204b6957462 100644 --- a/src/core/lib/security/security_connector/security_connector.h +++ b/src/core/lib/security/security_connector/security_connector.h @@ -53,7 +53,7 @@ class grpc_security_connector ? "security_connector_refcount" : nullptr), url_scheme_(url_scheme) {} - virtual ~grpc_security_connector() = default; + ~grpc_security_connector() override = default; /* Check the peer. Callee takes ownership of the peer object. When done, sets *auth_context and invokes on_peer_checked. */ diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc index 4566657da72..5563d5bd6a4 100644 --- a/src/core/lib/security/transport/security_handshaker.cc +++ b/src/core/lib/security/transport/security_handshaker.cc @@ -499,7 +499,7 @@ class FailHandshaker : public Handshaker { } private: - virtual ~FailHandshaker() = default; + ~FailHandshaker() override = default; }; // diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index c94551545d1..4c8395836b2 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -936,7 +936,7 @@ class Server::ChannelData::ConnectivityWatcher GRPC_CHANNEL_INTERNAL_REF(chand_->channel_, "connectivity"); } - ~ConnectivityWatcher() { + ~ConnectivityWatcher() override { GRPC_CHANNEL_INTERNAL_UNREF(chand_->channel_, "connectivity"); } diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h index 3a13b6f404e..af8ddab8c99 100644 --- a/src/core/lib/surface/server.h +++ b/src/core/lib/surface/server.h @@ -71,7 +71,7 @@ class Server : public InternallyRefCounted { /// listening and initiate destruction of the listener. class ListenerInterface : public Orphanable { public: - virtual ~ListenerInterface() = default; + ~ListenerInterface() override = default; /// Starts listening. This listener may refer to the pollset object beyond /// this call, so it is a pointer rather than a reference. @@ -88,7 +88,7 @@ class Server : public InternallyRefCounted { }; explicit Server(const grpc_channel_args* args); - ~Server(); + ~Server() override; void Orphan() override; diff --git a/src/core/lib/transport/byte_stream.h b/src/core/lib/transport/byte_stream.h index ecb605ad9bb..e83fb626b32 100644 --- a/src/core/lib/transport/byte_stream.h +++ b/src/core/lib/transport/byte_stream.h @@ -40,7 +40,7 @@ namespace grpc_core { class ByteStream : public Orphanable { public: - virtual ~ByteStream() {} + ~ByteStream() override {} // Returns true if the bytes are available immediately (in which case // on_complete will not be called), or false if the bytes will be available @@ -92,7 +92,7 @@ class SliceBufferByteStream : public ByteStream { // Removes all slices in slice_buffer, leaving it empty. SliceBufferByteStream(grpc_slice_buffer* slice_buffer, uint32_t flags); - ~SliceBufferByteStream(); + ~SliceBufferByteStream() override; void Orphan() override; @@ -126,7 +126,7 @@ class ByteStreamCache { public: explicit CachingByteStream(ByteStreamCache* cache); - ~CachingByteStream(); + ~CachingByteStream() override; void Orphan() override; diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h index 6b1d68cf8ef..cad34c27003 100644 --- a/src/core/lib/transport/connectivity_state.h +++ b/src/core/lib/transport/connectivity_state.h @@ -48,7 +48,7 @@ const char* ConnectivityStateName(grpc_connectivity_state state); class ConnectivityStateWatcherInterface : public InternallyRefCounted { public: - virtual ~ConnectivityStateWatcherInterface() = default; + ~ConnectivityStateWatcherInterface() override = default; // Notifies the watcher that the state has changed to new_state. virtual void Notify(grpc_connectivity_state new_state, @@ -63,12 +63,12 @@ class ConnectivityStateWatcherInterface class AsyncConnectivityStateWatcherInterface : public ConnectivityStateWatcherInterface { public: - virtual ~AsyncConnectivityStateWatcherInterface() = default; + ~AsyncConnectivityStateWatcherInterface() override = default; // Schedules a closure on the ExecCtx to invoke // OnConnectivityStateChange() asynchronously. void Notify(grpc_connectivity_state new_state, - const absl::Status& status) override final; + const absl::Status& status) final; protected: class Notifier; diff --git a/src/core/tsi/ssl/session_cache/ssl_session_cache.h b/src/core/tsi/ssl/session_cache/ssl_session_cache.h index 5d91af7b18d..e805ed6b14e 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session_cache.h +++ b/src/core/tsi/ssl/session_cache/ssl_session_cache.h @@ -53,7 +53,7 @@ class SslSessionLRUCache : public grpc_core::RefCounted { // Use Create function instead of using this directly. explicit SslSessionLRUCache(size_t capacity); - ~SslSessionLRUCache(); + ~SslSessionLRUCache() override; // Not copyable nor movable. SslSessionLRUCache(const SslSessionLRUCache&) = delete; diff --git a/src/cpp/client/secure_credentials.h b/src/cpp/client/secure_credentials.h index 0c47701ec3c..f9fa5e4a67b 100644 --- a/src/cpp/client/secure_credentials.h +++ b/src/cpp/client/secure_credentials.h @@ -37,7 +37,7 @@ class Channel; class SecureChannelCredentials final : public ChannelCredentials { public: explicit SecureChannelCredentials(grpc_channel_credentials* c_creds); - ~SecureChannelCredentials() { + ~SecureChannelCredentials() override { if (c_creds_ != nullptr) c_creds_->Unref(); } grpc_channel_credentials* GetRawCreds() { return c_creds_; } @@ -59,7 +59,7 @@ class SecureChannelCredentials final : public ChannelCredentials { class SecureCallCredentials final : public CallCredentials { public: explicit SecureCallCredentials(grpc_call_credentials* c_creds); - ~SecureCallCredentials() { + ~SecureCallCredentials() override { if (c_creds_ != nullptr) c_creds_->Unref(); } grpc_call_credentials* GetRawCreds() { return c_creds_; } diff --git a/src/cpp/common/alarm.cc b/src/cpp/common/alarm.cc index a2612874b20..3926e4ad7db 100644 --- a/src/cpp/common/alarm.cc +++ b/src/cpp/common/alarm.cc @@ -41,7 +41,7 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag { gpr_ref_init(&refs_, 1); grpc_timer_init_unset(&timer_); } - ~AlarmImpl() {} + ~AlarmImpl() override {} bool FinalizeResult(void** tag, bool* /*status*/) override { *tag = tag_; Unref(); diff --git a/src/cpp/common/secure_auth_context.h b/src/cpp/common/secure_auth_context.h index 3375237c34b..83c222749b8 100644 --- a/src/cpp/common/secure_auth_context.h +++ b/src/cpp/common/secure_auth_context.h @@ -49,7 +49,7 @@ class SecureAuthContext final : public AuthContext { void AddProperty(const std::string& key, const grpc::string_ref& value) override; - virtual bool SetPeerIdentityPropertyName(const std::string& name) override; + bool SetPeerIdentityPropertyName(const std::string& name) override; private: grpc_core::RefCountedPtr ctx_; diff --git a/src/cpp/server/channel_argument_option.cc b/src/cpp/server/channel_argument_option.cc index a8e5e52a770..680b0ee0484 100644 --- a/src/cpp/server/channel_argument_option.cc +++ b/src/cpp/server/channel_argument_option.cc @@ -27,10 +27,10 @@ std::unique_ptr MakeChannelArgumentOption( StringOption(const std::string& name, const std::string& value) : name_(name), value_(value) {} - virtual void UpdateArguments(ChannelArguments* args) override { + void UpdateArguments(ChannelArguments* args) override { args->SetString(name_, value_); } - virtual void UpdatePlugins( + void UpdatePlugins( std::vector>* /*plugins*/) override {} @@ -48,10 +48,10 @@ std::unique_ptr MakeChannelArgumentOption( IntOption(const std::string& name, int value) : name_(name), value_(value) {} - virtual void UpdateArguments(ChannelArguments* args) override { + void UpdateArguments(ChannelArguments* args) override { args->SetInt(name_, value_); } - virtual void UpdatePlugins( + void UpdatePlugins( std::vector>* /*plugins*/) override {} diff --git a/src/cpp/server/dynamic_thread_pool.h b/src/cpp/server/dynamic_thread_pool.h index 6f9f943bc38..3bc7b677bad 100644 --- a/src/cpp/server/dynamic_thread_pool.h +++ b/src/cpp/server/dynamic_thread_pool.h @@ -34,7 +34,7 @@ namespace grpc { class DynamicThreadPool final : public ThreadPoolInterface { public: explicit DynamicThreadPool(int reserve_threads); - ~DynamicThreadPool(); + ~DynamicThreadPool() override; void Add(const std::function& callback) override; diff --git a/src/cpp/server/health/default_health_check_service.h b/src/cpp/server/health/default_health_check_service.h index 0d4b60ec0da..e62189bd08e 100644 --- a/src/cpp/server/health/default_health_check_service.h +++ b/src/cpp/server/health/default_health_check_service.h @@ -56,7 +56,7 @@ class DefaultHealthCheckService final : public HealthCheckServiceInterface { HealthCheckServiceImpl(DefaultHealthCheckService* database, std::unique_ptr cq); - ~HealthCheckServiceImpl(); + ~HealthCheckServiceImpl() override; void StartServingThread(); diff --git a/src/cpp/server/load_reporter/load_reporter_async_service_impl.h b/src/cpp/server/load_reporter/load_reporter_async_service_impl.h index 969e20f6245..d8452955fd3 100644 --- a/src/cpp/server/load_reporter/load_reporter_async_service_impl.h +++ b/src/cpp/server/load_reporter/load_reporter_async_service_impl.h @@ -41,7 +41,7 @@ class LoadReporterAsyncServiceImpl public: explicit LoadReporterAsyncServiceImpl( std::unique_ptr cq); - ~LoadReporterAsyncServiceImpl(); + ~LoadReporterAsyncServiceImpl() override; // Starts the working thread. void StartThread(); diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 361a087a57f..6bc0b201f61 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -81,12 +81,16 @@ void InitGlobalCallbacks() { class ShutdownTag : public internal::CompletionQueueTag { public: - bool FinalizeResult(void** /*tag*/, bool* /*status*/) { return false; } + bool FinalizeResult(void** /*tag*/, bool* /*status*/) override { + return false; + } }; class DummyTag : public internal::CompletionQueueTag { public: - bool FinalizeResult(void** /*tag*/, bool* /*status*/) { return true; } + bool FinalizeResult(void** /*tag*/, bool* /*status*/) override { + return true; + } }; class UnimplementedAsyncRequestContext { @@ -310,7 +314,7 @@ class Server::UnimplementedAsyncResponse final grpc::internal::CallOpServerSendStatus> { public: UnimplementedAsyncResponse(UnimplementedAsyncRequest* request); - ~UnimplementedAsyncResponse() { delete request_; } + ~UnimplementedAsyncResponse() override { delete request_; } bool FinalizeResult(void** tag, bool* status) override { if (grpc::internal::CallOpSet< @@ -343,7 +347,7 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag { grpc_metadata_array_init(&request_metadata_); } - ~SyncRequest() { + ~SyncRequest() override { if (call_details_) { delete call_details_; } @@ -567,7 +571,7 @@ class Server::CallbackRequest final data->details = call_details_; } - ~CallbackRequest() { + ~CallbackRequest() override { delete call_details_; grpc_metadata_array_destroy(&request_metadata_); if (has_request_payload_ && request_payload_) { diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 9cd6b2a4f6a..f3cb004f65f 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -62,7 +62,7 @@ class ServerContextBase::CompletionOp final CompletionOp(CompletionOp&&) = delete; CompletionOp& operator=(CompletionOp&&) = delete; - ~CompletionOp() { + ~CompletionOp() override { if (call_.server_rpc_info()) { call_.server_rpc_info()->Unref(); } diff --git a/test/core/gprpp/dual_ref_counted_test.cc b/test/core/gprpp/dual_ref_counted_test.cc index 3dd39ff1e4f..53fe0882d3b 100644 --- a/test/core/gprpp/dual_ref_counted_test.cc +++ b/test/core/gprpp/dual_ref_counted_test.cc @@ -30,7 +30,7 @@ namespace { class Foo : public DualRefCounted { public: Foo() = default; - ~Foo() { GPR_ASSERT(shutting_down_); } + ~Foo() override { GPR_ASSERT(shutting_down_); } void Orphan() override { shutting_down_ = true; } @@ -75,7 +75,7 @@ TEST(DualRefCounted, RefIfNonZero) { class FooWithTracing : public DualRefCounted { public: FooWithTracing() : DualRefCounted("FooWithTracing") {} - ~FooWithTracing() { GPR_ASSERT(shutting_down_); } + ~FooWithTracing() override { GPR_ASSERT(shutting_down_); } void Orphan() override { shutting_down_ = true; } diff --git a/test/core/gprpp/manual_constructor_test.cc b/test/core/gprpp/manual_constructor_test.cc index 5f41920391a..828f2f89aa9 100644 --- a/test/core/gprpp/manual_constructor_test.cc +++ b/test/core/gprpp/manual_constructor_test.cc @@ -39,7 +39,7 @@ class A { class B : public A { public: B() {} - ~B() {} + ~B() override {} const char* foo() override { return "B_foo"; } char get_junk() { return junk[0]; } @@ -50,8 +50,8 @@ class B : public A { class C : public B { public: C() {} - ~C() {} - virtual const char* bar() { return "C_bar"; } + ~C() override {} + const char* bar() override { return "C_bar"; } char get_more_junk() { return more_junk[0]; } private: @@ -60,7 +60,7 @@ class C : public B { class D : public A { public: - virtual const char* bar() { return "D_bar"; } + const char* bar() override { return "D_bar"; } }; static void basic_test() { diff --git a/test/core/gprpp/ref_counted_ptr_test.cc b/test/core/gprpp/ref_counted_ptr_test.cc index a32957aaf20..bf202970141 100644 --- a/test/core/gprpp/ref_counted_ptr_test.cc +++ b/test/core/gprpp/ref_counted_ptr_test.cc @@ -266,7 +266,7 @@ class Bar : public DualRefCounted { explicit Bar(int value) : value_(value) {} - ~Bar() { GPR_ASSERT(shutting_down_); } + ~Bar() override { GPR_ASSERT(shutting_down_); } void Orphan() override { shutting_down_ = true; } @@ -422,7 +422,7 @@ class BarWithTracing : public DualRefCounted { public: BarWithTracing() : DualRefCounted("BarWithTracing") {} - ~BarWithTracing() { GPR_ASSERT(shutting_down_); } + ~BarWithTracing() override { GPR_ASSERT(shutting_down_); } void Orphan() override { shutting_down_ = true; } @@ -442,7 +442,7 @@ class WeakBaseClass : public DualRefCounted { public: WeakBaseClass() {} - ~WeakBaseClass() { GPR_ASSERT(shutting_down_); } + ~WeakBaseClass() override { GPR_ASSERT(shutting_down_); } void Orphan() override { shutting_down_ = true; } diff --git a/test/core/handshake/readahead_handshaker_server_ssl.cc b/test/core/handshake/readahead_handshaker_server_ssl.cc index 36f79e8193f..c1468503e7b 100644 --- a/test/core/handshake/readahead_handshaker_server_ssl.cc +++ b/test/core/handshake/readahead_handshaker_server_ssl.cc @@ -53,7 +53,7 @@ namespace grpc_core { class ReadAheadHandshaker : public Handshaker { public: - virtual ~ReadAheadHandshaker() {} + ~ReadAheadHandshaker() override {} const char* name() const override { return "read_ahead"; } void Shutdown(grpc_error* /*why*/) override {} void DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/, diff --git a/test/core/security/credentials_test.cc b/test/core/security/credentials_test.cc index a3f91b21dad..308b6fd0f35 100644 --- a/test/core/security/credentials_test.cc +++ b/test/core/security/credentials_test.cc @@ -1579,19 +1579,19 @@ struct fake_call_creds : public grpc_call_credentials { grpc_slice_unref(value); } - ~fake_call_creds() { GRPC_MDELEM_UNREF(dummy_md_); } + ~fake_call_creds() override { GRPC_MDELEM_UNREF(dummy_md_); } bool get_request_metadata(grpc_polling_entity* pollent, grpc_auth_metadata_context context, grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata, - grpc_error** error) { + grpc_error** error) override { grpc_credentials_mdelem_array_add(md_array, dummy_md_); return true; } void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array, - grpc_error* error) {} + grpc_error* error) override {} private: grpc_mdelem dummy_md_; @@ -2001,9 +2001,10 @@ class TestExternalAccountCredentials final : ExternalAccountCredentials(std::move(options), std::move(scopes)) {} protected: - void RetrieveSubjectToken(const HTTPRequestContext* ctx, - const ExternalAccountCredentialsOptions& options, - std::function cb) { + void RetrieveSubjectToken( + const HTTPRequestContext* ctx, + const ExternalAccountCredentialsOptions& options, + std::function cb) override { cb("test_subject_token", GRPC_ERROR_NONE); } }; diff --git a/test/core/security/grpc_tls_certificate_distributor_test.cc b/test/core/security/grpc_tls_certificate_distributor_test.cc index 83456eafa3a..6c67770bffe 100644 --- a/test/core/security/grpc_tls_certificate_distributor_test.cc +++ b/test/core/security/grpc_tls_certificate_distributor_test.cc @@ -126,7 +126,7 @@ class GrpcTlsCertificateDistributorTest : public ::testing::Test { } // dtor sets state->watcher to nullptr. - ~TlsCertificatesTestWatcher() { state_->watcher = nullptr; } + ~TlsCertificatesTestWatcher() override { state_->watcher = nullptr; } void OnCertificatesChanged( absl::optional root_certs, diff --git a/test/core/transport/connectivity_state_test.cc b/test/core/transport/connectivity_state_test.cc index 9caff9db9b8..21ea0114be7 100644 --- a/test/core/transport/connectivity_state_test.cc +++ b/test/core/transport/connectivity_state_test.cc @@ -49,7 +49,7 @@ class Watcher : public ConnectivityStateWatcherInterface { status_(status), destroyed_(destroyed) {} - ~Watcher() { + ~Watcher() override { if (destroyed_ != nullptr) *destroyed_ = true; } diff --git a/test/core/util/fuzzer_corpus_test.cc b/test/core/util/fuzzer_corpus_test.cc index 70dadcbb5dc..25b6a24a7c0 100644 --- a/test/core/util/fuzzer_corpus_test.cc +++ b/test/core/util/fuzzer_corpus_test.cc @@ -73,9 +73,10 @@ TEST_P(FuzzerCorpusTest, RunOneExample) { class ExampleGenerator : public ::testing::internal::ParamGeneratorInterface { public: - virtual ::testing::internal::ParamIteratorInterface* Begin() - const; - virtual ::testing::internal::ParamIteratorInterface* End() const; + ::testing::internal::ParamIteratorInterface* Begin() + const override; + ::testing::internal::ParamIteratorInterface* End() + const override; private: void Materialize() const { @@ -124,13 +125,13 @@ class ExampleIterator std::vector::const_iterator begin) : base_(base_), begin_(begin), current_(begin) {} - virtual const ExampleGenerator* BaseGenerator() const { return &base_; } + const ExampleGenerator* BaseGenerator() const override { return &base_; } - virtual void Advance() { current_++; } - virtual ExampleIterator* Clone() const { return new ExampleIterator(*this); } - virtual const std::string* Current() const { return &*current_; } + void Advance() override { current_++; } + ExampleIterator* Clone() const override { return new ExampleIterator(*this); } + const std::string* Current() const override { return &*current_; } - virtual bool Equals(const ParamIteratorInterface& other) const { + bool Equals(const ParamIteratorInterface& other) const override { return &base_ == other.BaseGenerator() && current_ == dynamic_cast(&other)->current_; } diff --git a/test/cpp/end2end/client_interceptors_end2end_test.cc b/test/cpp/end2end/client_interceptors_end2end_test.cc index 58d9c2a8bb2..baf93e023d3 100644 --- a/test/cpp/end2end/client_interceptors_end2end_test.cc +++ b/test/cpp/end2end/client_interceptors_end2end_test.cc @@ -64,7 +64,7 @@ class HijackingInterceptor : public experimental::Interceptor { EXPECT_EQ(info->type(), experimental::ClientRpcInfo::Type::UNARY); } - virtual void Intercept(experimental::InterceptorBatchMethods* methods) { + void Intercept(experimental::InterceptorBatchMethods* methods) override { bool hijack = false; if (methods->QueryInterceptionHookPoint( experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { @@ -155,7 +155,7 @@ class HijackingInterceptor : public experimental::Interceptor { class HijackingInterceptorFactory : public experimental::ClientInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateClientInterceptor( + experimental::Interceptor* CreateClientInterceptor( experimental::ClientRpcInfo* info) override { return new HijackingInterceptor(info); } @@ -169,7 +169,7 @@ class HijackingInterceptorMakesAnotherCall : public experimental::Interceptor { EXPECT_EQ(strcmp("/grpc.testing.EchoTestService/Echo", info->method()), 0); } - virtual void Intercept(experimental::InterceptorBatchMethods* methods) { + void Intercept(experimental::InterceptorBatchMethods* methods) override { if (methods->QueryInterceptionHookPoint( experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { auto* map = methods->GetSendInitialMetadata(); @@ -277,7 +277,7 @@ class HijackingInterceptorMakesAnotherCall : public experimental::Interceptor { class HijackingInterceptorMakesAnotherCallFactory : public experimental::ClientInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateClientInterceptor( + experimental::Interceptor* CreateClientInterceptor( experimental::ClientRpcInfo* info) override { return new HijackingInterceptorMakesAnotherCall(info); } @@ -289,7 +289,7 @@ class BidiStreamingRpcHijackingInterceptor : public experimental::Interceptor { info_ = info; } - virtual void Intercept(experimental::InterceptorBatchMethods* methods) { + void Intercept(experimental::InterceptorBatchMethods* methods) override { bool hijack = false; if (methods->QueryInterceptionHookPoint( experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { @@ -358,7 +358,7 @@ class ClientStreamingRpcHijackingInterceptor ClientStreamingRpcHijackingInterceptor(experimental::ClientRpcInfo* info) { info_ = info; } - virtual void Intercept(experimental::InterceptorBatchMethods* methods) { + void Intercept(experimental::InterceptorBatchMethods* methods) override { bool hijack = false; if (methods->QueryInterceptionHookPoint( experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { @@ -400,7 +400,7 @@ bool ClientStreamingRpcHijackingInterceptor::got_failed_send_ = false; class ClientStreamingRpcHijackingInterceptorFactory : public experimental::ClientInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateClientInterceptor( + experimental::Interceptor* CreateClientInterceptor( experimental::ClientRpcInfo* info) override { return new ClientStreamingRpcHijackingInterceptor(info); } @@ -414,7 +414,7 @@ class ServerStreamingRpcHijackingInterceptor got_failed_message_ = false; } - virtual void Intercept(experimental::InterceptorBatchMethods* methods) { + void Intercept(experimental::InterceptorBatchMethods* methods) override { bool hijack = false; if (methods->QueryInterceptionHookPoint( experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { @@ -498,7 +498,7 @@ bool ServerStreamingRpcHijackingInterceptor::got_failed_message_ = false; class ServerStreamingRpcHijackingInterceptorFactory : public experimental::ClientInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateClientInterceptor( + experimental::Interceptor* CreateClientInterceptor( experimental::ClientRpcInfo* info) override { return new ServerStreamingRpcHijackingInterceptor(info); } @@ -507,7 +507,7 @@ class ServerStreamingRpcHijackingInterceptorFactory class BidiStreamingRpcHijackingInterceptorFactory : public experimental::ClientInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateClientInterceptor( + experimental::Interceptor* CreateClientInterceptor( experimental::ClientRpcInfo* info) override { return new BidiStreamingRpcHijackingInterceptor(info); } @@ -528,7 +528,7 @@ class LoggingInterceptor : public experimental::Interceptor { post_recv_status_ = false; } - virtual void Intercept(experimental::InterceptorBatchMethods* methods) { + void Intercept(experimental::InterceptorBatchMethods* methods) override { if (methods->QueryInterceptionHookPoint( experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { auto* map = methods->GetSendInitialMetadata(); @@ -677,7 +677,7 @@ bool LoggingInterceptor::post_recv_status_; class LoggingInterceptorFactory : public experimental::ClientInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateClientInterceptor( + experimental::Interceptor* CreateClientInterceptor( experimental::ClientRpcInfo* info) override { return new LoggingInterceptor(info); } @@ -717,7 +717,9 @@ class ParameterizedClientInterceptorsEnd2endTest server_ = builder.BuildAndStart(); } - ~ParameterizedClientInterceptorsEnd2endTest() { server_->Shutdown(); } + ~ParameterizedClientInterceptorsEnd2endTest() override { + server_->Shutdown(); + } void SendRPC(const std::shared_ptr& channel) { switch (GetParam().type()) { @@ -791,7 +793,7 @@ class ClientInterceptorsEnd2endTest server_ = builder.BuildAndStart(); } - ~ClientInterceptorsEnd2endTest() { server_->Shutdown(); } + ~ClientInterceptorsEnd2endTest() override { server_->Shutdown(); } std::string server_address_; TestServiceImpl service_; @@ -890,7 +892,7 @@ class ClientInterceptorsCallbackEnd2endTest : public ::testing::Test { server_ = builder.BuildAndStart(); } - ~ClientInterceptorsCallbackEnd2endTest() { server_->Shutdown(); } + ~ClientInterceptorsCallbackEnd2endTest() override { server_->Shutdown(); } std::string server_address_; TestServiceImpl service_; @@ -953,7 +955,7 @@ class ClientInterceptorsStreamingEnd2endTest : public ::testing::Test { server_ = builder.BuildAndStart(); } - ~ClientInterceptorsStreamingEnd2endTest() { server_->Shutdown(); } + ~ClientInterceptorsStreamingEnd2endTest() override { server_->Shutdown(); } std::string server_address_; EchoTestServiceStreamingImpl service_; @@ -1103,7 +1105,7 @@ class ClientGlobalInterceptorEnd2endTest : public ::testing::Test { server_ = builder.BuildAndStart(); } - ~ClientGlobalInterceptorEnd2endTest() { server_->Shutdown(); } + ~ClientGlobalInterceptorEnd2endTest() override { server_->Shutdown(); } std::string server_address_; TestServiceImpl service_; diff --git a/test/cpp/end2end/delegating_channel_test.cc b/test/cpp/end2end/delegating_channel_test.cc index e3e975bbfc8..9b371e29a29 100644 --- a/test/cpp/end2end/delegating_channel_test.cc +++ b/test/cpp/end2end/delegating_channel_test.cc @@ -64,7 +64,7 @@ class DelegatingChannelTest : public ::testing::Test { server_ = builder.BuildAndStart(); } - ~DelegatingChannelTest() { server_->Shutdown(); } + ~DelegatingChannelTest() override { server_->Shutdown(); } std::string server_address_; TestServiceImpl service_; diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index f157d20cc6f..c7fbd852861 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -1858,7 +1858,7 @@ class CredentialsInterceptor : public experimental::Interceptor { public: CredentialsInterceptor(experimental::ClientRpcInfo* info) : info_(info) {} - void Intercept(experimental::InterceptorBatchMethods* methods) { + void Intercept(experimental::InterceptorBatchMethods* methods) override { if (methods->QueryInterceptionHookPoint( experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { std::shared_ptr creds = @@ -1875,7 +1875,7 @@ class CredentialsInterceptor : public experimental::Interceptor { class CredentialsInterceptorFactory : public experimental::ClientInterceptorFactoryInterface { CredentialsInterceptor* CreateClientInterceptor( - experimental::ClientRpcInfo* info) { + experimental::ClientRpcInfo* info) override { return new CredentialsInterceptor(info); } }; @@ -2245,7 +2245,7 @@ class ResourceQuotaEnd2endTest : public End2endTest { ResourceQuotaEnd2endTest() : server_resource_quota_("server_resource_quota") {} - virtual void ConfigureServerBuilder(ServerBuilder* builder) override { + void ConfigureServerBuilder(ServerBuilder* builder) override { builder->SetResourceQuota(server_resource_quota_); } diff --git a/test/cpp/end2end/filter_end2end_test.cc b/test/cpp/end2end/filter_end2end_test.cc index 062a47a8bef..56ea3438731 100644 --- a/test/cpp/end2end/filter_end2end_test.cc +++ b/test/cpp/end2end/filter_end2end_test.cc @@ -101,7 +101,7 @@ int GetCallCounterValue() { class ChannelDataImpl : public ChannelData { public: grpc_error* Init(grpc_channel_element* /*elem*/, - grpc_channel_element_args* /*args*/) { + grpc_channel_element_args* /*args*/) override { IncrementConnectionCounter(); return GRPC_ERROR_NONE; } diff --git a/test/cpp/end2end/interceptors_util.h b/test/cpp/end2end/interceptors_util.h index 4eafcea2670..01009cdc93f 100644 --- a/test/cpp/end2end/interceptors_util.h +++ b/test/cpp/end2end/interceptors_util.h @@ -33,7 +33,7 @@ class DummyInterceptor : public experimental::Interceptor { public: DummyInterceptor() {} - virtual void Intercept(experimental::InterceptorBatchMethods* methods) { + void Intercept(experimental::InterceptorBatchMethods* methods) override { if (methods->QueryInterceptionHookPoint( experimental::InterceptionHookPoints::PRE_SEND_INITIAL_METADATA)) { num_times_run_++; @@ -71,12 +71,12 @@ class DummyInterceptorFactory : public experimental::ClientInterceptorFactoryInterface, public experimental::ServerInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateClientInterceptor( + experimental::Interceptor* CreateClientInterceptor( experimental::ClientRpcInfo* /*info*/) override { return new DummyInterceptor(); } - virtual experimental::Interceptor* CreateServerInterceptor( + experimental::Interceptor* CreateServerInterceptor( experimental::ServerRpcInfo* /*info*/) override { return new DummyInterceptor(); } @@ -87,12 +87,12 @@ class NullInterceptorFactory : public experimental::ClientInterceptorFactoryInterface, public experimental::ServerInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateClientInterceptor( + experimental::Interceptor* CreateClientInterceptor( experimental::ClientRpcInfo* /*info*/) override { return nullptr; } - virtual experimental::Interceptor* CreateServerInterceptor( + experimental::Interceptor* CreateServerInterceptor( experimental::ServerRpcInfo* /*info*/) override { return nullptr; } diff --git a/test/cpp/end2end/message_allocator_end2end_test.cc b/test/cpp/end2end/message_allocator_end2end_test.cc index 2c022940b29..c2cd0c19f7f 100644 --- a/test/cpp/end2end/message_allocator_end2end_test.cc +++ b/test/cpp/end2end/message_allocator_end2end_test.cc @@ -127,7 +127,7 @@ class MessageAllocatorEnd2endTestBase } } - ~MessageAllocatorEnd2endTestBase() = default; + ~MessageAllocatorEnd2endTestBase() override = default; void CreateServer( experimental::MessageAllocator* allocator) { diff --git a/test/cpp/end2end/server_interceptors_end2end_test.cc b/test/cpp/end2end/server_interceptors_end2end_test.cc index 984651d9042..02488c8ac4b 100644 --- a/test/cpp/end2end/server_interceptors_end2end_test.cc +++ b/test/cpp/end2end/server_interceptors_end2end_test.cc @@ -140,7 +140,7 @@ class LoggingInterceptor : public experimental::Interceptor { class LoggingInterceptorFactory : public experimental::ServerInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateServerInterceptor( + experimental::Interceptor* CreateServerInterceptor( experimental::ServerRpcInfo* info) override { return new LoggingInterceptor(info); } @@ -170,7 +170,7 @@ class SyncSendMessageTester : public experimental::Interceptor { class SyncSendMessageTesterFactory : public experimental::ServerInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateServerInterceptor( + experimental::Interceptor* CreateServerInterceptor( experimental::ServerRpcInfo* info) override { return new SyncSendMessageTester(info); } @@ -205,7 +205,7 @@ class SyncSendMessageVerifier : public experimental::Interceptor { class SyncSendMessageVerifierFactory : public experimental::ServerInterceptorFactoryInterface { public: - virtual experimental::Interceptor* CreateServerInterceptor( + experimental::Interceptor* CreateServerInterceptor( experimental::ServerRpcInfo* info) override { return new SyncSendMessageVerifier(info); } diff --git a/test/cpp/end2end/time_change_test.cc b/test/cpp/end2end/time_change_test.cc index 066914310eb..3fc58c2fac5 100644 --- a/test/cpp/end2end/time_change_test.cc +++ b/test/cpp/end2end/time_change_test.cc @@ -148,14 +148,14 @@ class TimeChangeTest : public ::testing::Test { static void TearDownTestCase() { server_.reset(); } - void SetUp() { + void SetUp() override { channel_ = grpc::CreateChannel(server_address_, InsecureChannelCredentials()); GPR_ASSERT(channel_); stub_ = grpc::testing::EchoTestService::NewStub(channel_); } - void TearDown() { reset_now_offset(); } + void TearDown() override { reset_now_offset(); } std::unique_ptr CreateStub() { return grpc::testing::EchoTestService::NewStub(channel_); 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 d007971ed58..0e947c6c014 100644 --- a/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc +++ b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc @@ -70,7 +70,7 @@ class StatsPluginEnd2EndTest : public ::testing::Test { protected: static void SetUpTestCase() { RegisterOpenCensusPlugin(); } - void SetUp() { + void SetUp() override { // Set up a synchronous server on a different thread to avoid the asynch // interface. ::grpc::ServerBuilder builder; @@ -89,7 +89,7 @@ class StatsPluginEnd2EndTest : public ::testing::Test { server_address_, ::grpc::InsecureChannelCredentials())); } - void TearDown() { + void TearDown() override { server_->Shutdown(); server_thread_.join(); } diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 153aec7c9c2..f7e3c8c0e9b 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -139,7 +139,7 @@ class TestServiceImpl : public TestService::Service { public: Status EmptyCall(ServerContext* context, const grpc::testing::Empty* /*request*/, - grpc::testing::Empty* /*response*/) { + grpc::testing::Empty* /*response*/) override { MaybeEchoMetadata(context); return Status::OK; } @@ -147,7 +147,7 @@ class TestServiceImpl : public TestService::Service { // Response contains current timestamp. We ignore everything in the request. Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* /*request*/, - SimpleResponse* response) { + SimpleResponse* response) override { gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); @@ -156,7 +156,7 @@ class TestServiceImpl : public TestService::Service { } Status UnaryCall(ServerContext* context, const SimpleRequest* request, - SimpleResponse* response) { + SimpleResponse* response) override { MaybeEchoMetadata(context); if (request->has_response_compressed()) { const bool compression_requested = request->response_compressed().value(); @@ -192,7 +192,7 @@ class TestServiceImpl : public TestService::Service { Status StreamingOutputCall( ServerContext* context, const StreamingOutputCallRequest* request, - ServerWriter* writer) { + ServerWriter* writer) override { StreamingOutputCallResponse response; bool write_success = true; for (int i = 0; write_success && i < request->response_parameters_size(); @@ -233,7 +233,7 @@ class TestServiceImpl : public TestService::Service { Status StreamingInputCall(ServerContext* context, ServerReader* reader, - StreamingInputCallResponse* response) { + StreamingInputCallResponse* response) override { StreamingInputCallRequest request; int aggregated_payload_size = 0; while (reader->Read(&request)) { @@ -253,7 +253,7 @@ class TestServiceImpl : public TestService::Service { Status FullDuplexCall( ServerContext* context, ServerReaderWriter* stream) { + StreamingOutputCallRequest>* stream) override { MaybeEchoMetadata(context); StreamingOutputCallRequest request; StreamingOutputCallResponse response; @@ -289,7 +289,7 @@ class TestServiceImpl : public TestService::Service { Status HalfDuplexCall( ServerContext* /*context*/, ServerReaderWriter* stream) { + StreamingOutputCallRequest>* stream) override { std::vector requests; StreamingOutputCallRequest request; while (stream->Read(&request)) { diff --git a/test/cpp/interop/reconnect_interop_server.cc b/test/cpp/interop/reconnect_interop_server.cc index 1e99d7cd9ab..d6b446d7947 100644 --- a/test/cpp/interop/reconnect_interop_server.cc +++ b/test/cpp/interop/reconnect_interop_server.cc @@ -69,7 +69,7 @@ class ReconnectServiceImpl : public ReconnectService::Service { reconnect_server_init(&tcp_server_); } - ~ReconnectServiceImpl() { + ~ReconnectServiceImpl() override { if (server_started_) { reconnect_server_destroy(&tcp_server_); } @@ -78,7 +78,7 @@ class ReconnectServiceImpl : public ReconnectService::Service { void Poll(int seconds) { reconnect_server_poll(&tcp_server_, seconds); } Status Start(ServerContext* /*context*/, const ReconnectParams* request, - Empty* /*response*/) { + Empty* /*response*/) override { bool start_server = true; std::unique_lock lock(mu_); while (serving_ && !shutdown_) { @@ -106,7 +106,7 @@ class ReconnectServiceImpl : public ReconnectService::Service { } Status Stop(ServerContext* /*context*/, const Empty* /*request*/, - ReconnectInfo* response) { + ReconnectInfo* response) override { // extract timestamps and set response Verify(response); reconnect_server_clear_timestamps(&tcp_server_); diff --git a/test/cpp/interop/xds_interop_client.cc b/test/cpp/interop/xds_interop_client.cc index db36ff76344..92d3ac9da5a 100644 --- a/test/cpp/interop/xds_interop_client.cc +++ b/test/cpp/interop/xds_interop_client.cc @@ -271,7 +271,7 @@ class LoadBalancerStatsServiceImpl : public LoadBalancerStatsService::Service { public: Status GetClientStats(ServerContext* context, const LoadBalancerStatsRequest* request, - LoadBalancerStatsResponse* response) { + LoadBalancerStatsResponse* response) override { int start_id; int end_id; XdsStatsWatcher* watcher; diff --git a/test/cpp/interop/xds_interop_server.cc b/test/cpp/interop/xds_interop_server.cc index 11a551e3cae..8e6f9bb5e3f 100644 --- a/test/cpp/interop/xds_interop_server.cc +++ b/test/cpp/interop/xds_interop_server.cc @@ -56,7 +56,7 @@ class TestServiceImpl : public TestService::Service { TestServiceImpl(const std::string& i) : hostname_(i) {} Status UnaryCall(ServerContext* context, const SimpleRequest* request, - SimpleResponse* response) { + SimpleResponse* response) override { response->set_server_id(FLAGS_server_id); response->set_hostname(hostname_); context->AddInitialMetadata("hostname", hostname_); @@ -64,7 +64,7 @@ class TestServiceImpl : public TestService::Service { } Status EmptyCall(ServerContext* context, const Empty* request, - Empty* response) { + Empty* response) override { context->AddInitialMetadata("hostname", hostname_); return Status::OK; } diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index 0fd8e1bf1a3..4b114167c43 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -703,7 +703,7 @@ class IsolatedCallFixture : public TrackCounters { cq_ = grpc_completion_queue_create_for_next(nullptr); } - void Finish(benchmark::State& state) { + void Finish(benchmark::State& state) override { grpc_completion_queue_destroy(cq_); grpc_channel_destroy(channel_); TrackCounters::Finish(state); diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index a27b77f4a1e..b16e177506a 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -104,13 +104,13 @@ class TrickledCHTTP2 : public EndpointPairFixture { } } - virtual ~TrickledCHTTP2() { + ~TrickledCHTTP2() override { if (stats_ != nullptr) { grpc_passthru_endpoint_stats_destroy(stats_); } } - void AddToLabel(std::ostream& out, benchmark::State& state) { + void AddToLabel(std::ostream& out, benchmark::State& state) override { out << " writes/iter:" << ((double)stats_->num_writes / (double)state.iterations()) << " cli_transport_stalls/iter:" diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h index 73b4e41900e..9ba190b691f 100644 --- a/test/cpp/microbenchmarks/fullstack_fixtures.h +++ b/test/cpp/microbenchmarks/fullstack_fixtures.h @@ -84,7 +84,7 @@ class FullstackFixture : public BaseFixture { } } - virtual ~FullstackFixture() { + ~FullstackFixture() override { server_->Shutdown(); cq_->Shutdown(); void* tag; @@ -93,7 +93,7 @@ class FullstackFixture : public BaseFixture { } } - void AddToLabel(std::ostream& out, benchmark::State& state) { + void AddToLabel(std::ostream& out, benchmark::State& state) override { BaseFixture::AddToLabel(out, state); out << " polls/iter:" << static_cast(grpc_get_cq_poll_num(this->cq()->cq())) / @@ -115,7 +115,7 @@ class TCP : public FullstackFixture { FixtureConfiguration()) : FullstackFixture(service, fixture_configuration, MakeAddress(&port_)) {} - ~TCP() { grpc_recycle_unused_port(port_); } + ~TCP() override { grpc_recycle_unused_port(port_); } private: int port_; @@ -134,7 +134,7 @@ class UDS : public FullstackFixture { FixtureConfiguration()) : FullstackFixture(service, fixture_configuration, MakeAddress(&port_)) {} - ~UDS() { grpc_recycle_unused_port(port_); } + ~UDS() override { grpc_recycle_unused_port(port_); } private: int port_; @@ -154,7 +154,7 @@ class InProcess : public FullstackFixture { const FixtureConfiguration& fixture_configuration = FixtureConfiguration()) : FullstackFixture(service, fixture_configuration, "") {} - ~InProcess() {} + ~InProcess() override {} }; class EndpointPairFixture : public BaseFixture { @@ -209,7 +209,7 @@ class EndpointPairFixture : public BaseFixture { } } - virtual ~EndpointPairFixture() { + ~EndpointPairFixture() override { server_->Shutdown(); cq_->Shutdown(); void* tag; @@ -218,7 +218,7 @@ class EndpointPairFixture : public BaseFixture { } } - void AddToLabel(std::ostream& out, benchmark::State& state) { + void AddToLabel(std::ostream& out, benchmark::State& state) override { BaseFixture::AddToLabel(out, state); out << " polls/iter:" << static_cast(grpc_get_cq_poll_num(this->cq()->cq())) / @@ -261,13 +261,13 @@ class InProcessCHTTP2WithExplicitStats : public EndpointPairFixture { fixture_configuration), stats_(stats) {} - virtual ~InProcessCHTTP2WithExplicitStats() { + ~InProcessCHTTP2WithExplicitStats() override { if (stats_ != nullptr) { grpc_passthru_endpoint_stats_destroy(stats_); } } - void AddToLabel(std::ostream& out, benchmark::State& state) { + void AddToLabel(std::ostream& out, benchmark::State& state) override { EndpointPairFixture::AddToLabel(out, state); out << " writes/iter:" << static_cast(gpr_atm_no_barrier_load(&stats_->num_writes)) / diff --git a/test/cpp/performance/writes_per_rpc_test.cc b/test/cpp/performance/writes_per_rpc_test.cc index e262078e149..d3273ee7949 100644 --- a/test/cpp/performance/writes_per_rpc_test.cc +++ b/test/cpp/performance/writes_per_rpc_test.cc @@ -129,7 +129,7 @@ class InProcessCHTTP2 : public EndpointPairFixture { InProcessCHTTP2(Service* service, grpc_passthru_endpoint_stats* stats) : EndpointPairFixture(service, MakeEndpoints(stats)), stats_(stats) {} - virtual ~InProcessCHTTP2() { + ~InProcessCHTTP2() override { if (stats_ != nullptr) { grpc_passthru_endpoint_stats_destroy(stats_); } diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index 64f49827383..78e6c89fa17 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -441,7 +441,7 @@ class ClientImpl : public Client { ClientRequestCreator create_req(&request_, config.payload_config()); } - virtual ~ClientImpl() {} + ~ClientImpl() override {} const RequestType* request() { return &request_; } void WaitForChannelsToConnect() { diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index c3d9ae6de95..5c7c8a316b8 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -191,7 +191,7 @@ class AsyncClient : public ClientImpl { t = (t + 1) % cli_cqs_.size(); } } - virtual ~AsyncClient() { + ~AsyncClient() override { for (auto cq = cli_cqs_.begin(); cq != cli_cqs_.end(); cq++) { void* got_tag; bool ok; @@ -227,7 +227,7 @@ class AsyncClient : public ClientImpl { } return num_threads; } - void DestroyMultithreading() override final { + void DestroyMultithreading() final { for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) { std::lock_guard lock((*ss)->mutex); (*ss)->shutdown = true; @@ -254,7 +254,7 @@ class AsyncClient : public ClientImpl { return ctx; } - void ThreadFunc(size_t thread_idx, Client::Thread* t) override final { + void ThreadFunc(size_t thread_idx, Client::Thread* t) final { void* got_tag; bool ok; diff --git a/test/cpp/qps/client_callback.cc b/test/cpp/qps/client_callback.cc index 047f2358c82..f8a26e49d4a 100644 --- a/test/cpp/qps/client_callback.cc +++ b/test/cpp/qps/client_callback.cc @@ -75,7 +75,7 @@ class CallbackClient config.client_channels() * config.outstanding_rpcs_per_channel(); } - virtual ~CallbackClient() {} + ~CallbackClient() override {} /** * The main thread of the benchmark will be waiting on DestroyMultithreading. @@ -151,7 +151,7 @@ class CallbackUnaryClient final : public CallbackClient { } StartThreads(num_threads_); } - ~CallbackUnaryClient() {} + ~CallbackUnaryClient() override {} protected: bool ThreadFuncImpl(Thread* t, size_t thread_idx) override { @@ -223,7 +223,7 @@ class CallbackStreamingClient : public CallbackClient { } StartThreads(num_threads_); } - ~CallbackStreamingClient() {} + ~CallbackStreamingClient() override {} void AddHistogramEntry(double start, bool ok, Thread* thread_ptr) { // Update Histogram with data from the callback run @@ -244,7 +244,7 @@ class CallbackStreamingPingPongClient : public CallbackStreamingClient { public: CallbackStreamingPingPongClient(const ClientConfig& config) : CallbackStreamingClient(config) {} - ~CallbackStreamingPingPongClient() {} + ~CallbackStreamingPingPongClient() override {} }; class CallbackStreamingPingPongReactor final @@ -346,7 +346,7 @@ class CallbackStreamingPingPongClientImpl final reactor_.emplace_back( new CallbackStreamingPingPongReactor(this, std::move(ctx_[i]))); } - ~CallbackStreamingPingPongClientImpl() {} + ~CallbackStreamingPingPongClientImpl() override {} bool ThreadFuncImpl(Client::Thread* t, size_t thread_idx) override { for (size_t vector_idx = thread_idx; vector_idx < total_outstanding_rpcs_; diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index a0ec361c096..f042a035825 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -59,7 +59,7 @@ class SynchronousClient SetupLoadTest(config, num_threads_); } - virtual ~SynchronousClient() {} + ~SynchronousClient() override {} virtual bool InitThreadFuncImpl(size_t thread_idx) = 0; virtual bool ThreadFuncImpl(HistogramEntry* entry, size_t thread_idx) = 0; @@ -115,7 +115,7 @@ class SynchronousUnaryClient final : public SynchronousClient { : SynchronousClient(config) { StartThreads(num_threads_); } - ~SynchronousUnaryClient() {} + ~SynchronousUnaryClient() override {} bool InitThreadFuncImpl(size_t /*thread_idx*/) override { return true; } @@ -137,7 +137,7 @@ class SynchronousUnaryClient final : public SynchronousClient { } private: - void DestroyMultithreading() override final { EndThreads(); } + void DestroyMultithreading() final { EndThreads(); } }; template @@ -153,7 +153,7 @@ class SynchronousStreamingClient : public SynchronousClient { messages_issued_(num_threads_) { StartThreads(num_threads_); } - virtual ~SynchronousStreamingClient() { + ~SynchronousStreamingClient() override { CleanupAllStreams([this](size_t thread_idx) { // Don't log any kind of error since we may have canceled this stream_[thread_idx]->Finish().IgnoreError(); @@ -208,7 +208,7 @@ class SynchronousStreamingClient : public SynchronousClient { } private: - void DestroyMultithreading() override final { + void DestroyMultithreading() final { CleanupAllStreams( [this](size_t thread_idx) { context_[thread_idx].TryCancel(); }); EndThreads(); @@ -221,7 +221,7 @@ class SynchronousStreamingPingPongClient final public: SynchronousStreamingPingPongClient(const ClientConfig& config) : SynchronousStreamingClient(config) {} - ~SynchronousStreamingPingPongClient() { + ~SynchronousStreamingPingPongClient() override { CleanupAllStreams( [this](size_t thread_idx) { stream_[thread_idx]->WritesDone(); }); } @@ -278,7 +278,7 @@ class SynchronousStreamingFromClientClient final public: SynchronousStreamingFromClientClient(const ClientConfig& config) : SynchronousStreamingClient(config), last_issue_(num_threads_) {} - ~SynchronousStreamingFromClientClient() { + ~SynchronousStreamingFromClientClient() override { CleanupAllStreams( [this](size_t thread_idx) { stream_[thread_idx]->WritesDone(); }); } @@ -331,7 +331,7 @@ class SynchronousStreamingFromServerClient final public: SynchronousStreamingFromServerClient(const ClientConfig& config) : SynchronousStreamingClient(config), last_recv_(num_threads_) {} - ~SynchronousStreamingFromServerClient() {} + ~SynchronousStreamingFromServerClient() override {} private: std::vector last_recv_; @@ -377,7 +377,7 @@ class SynchronousStreamingBothWaysClient final public: SynchronousStreamingBothWaysClient(const ClientConfig& config) : SynchronousStreamingClient(config) {} - ~SynchronousStreamingBothWaysClient() { + ~SynchronousStreamingBothWaysClient() override { CleanupAllStreams( [this](size_t thread_idx) { stream_[thread_idx]->WritesDone(); }); } diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 51d410b1cbf..049fced1b29 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -162,7 +162,7 @@ class AsyncQpsServerTest final : public grpc::testing::Server { threads_.emplace_back(&AsyncQpsServerTest::ThreadFunc, this, i); } } - ~AsyncQpsServerTest() { + ~AsyncQpsServerTest() override { for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) { std::lock_guard lock((*ss)->mutex); (*ss)->shutdown = true; diff --git a/test/cpp/util/channelz_sampler_test.cc b/test/cpp/util/channelz_sampler_test.cc index 5a2751b58bc..efd01e78d40 100644 --- a/test/cpp/util/channelz_sampler_test.cc +++ b/test/cpp/util/channelz_sampler_test.cc @@ -66,7 +66,7 @@ std::string output_json("output.json"); class EchoServerImpl final : public grpc::testing::TestService::Service { Status EmptyCall(::grpc::ServerContext* context, const grpc::testing::Empty* request, - grpc::testing::Empty* response) { + grpc::testing::Empty* response) override { return Status::OK; } }; diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h index a1ceeadb3bd..c6dc62f571a 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.h +++ b/test/cpp/util/proto_reflection_descriptor_database.h @@ -40,7 +40,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase { explicit ProtoReflectionDescriptorDatabase( const std::shared_ptr& channel); - virtual ~ProtoReflectionDescriptorDatabase(); + ~ProtoReflectionDescriptorDatabase() override; // The following four methods implement DescriptorDatabase interfaces. //