diff --git a/source/common/filesystem/watcher_impl.cc b/source/common/filesystem/watcher_impl.cc index 5387dc015f2a6..7b18f293b0ab9 100644 --- a/source/common/filesystem/watcher_impl.cc +++ b/source/common/filesystem/watcher_impl.cc @@ -12,7 +12,7 @@ namespace Filesystem { WatcherImpl::WatcherImpl(Event::Dispatcher& dispatcher) - : dispatcher_(dispatcher), inotify_fd_(inotify_init1(IN_NONBLOCK)), + : inotify_fd_(inotify_init1(IN_NONBLOCK)), inotify_event_(dispatcher.createFileEvent(inotify_fd_, [this](uint32_t events) -> void { if (events & Event::FileReadyType::Read) { onInotifyEvent(); diff --git a/source/common/filesystem/watcher_impl.h b/source/common/filesystem/watcher_impl.h index 0fdae0e92e4f3..5544738db6d7a 100644 --- a/source/common/filesystem/watcher_impl.h +++ b/source/common/filesystem/watcher_impl.h @@ -33,7 +33,6 @@ class WatcherImpl : public Watcher, Logger::Loggable { void onInotifyEvent(); - Event::Dispatcher& dispatcher_; int inotify_fd_; Event::FileEventPtr inotify_event_; std::unordered_map callback_map_; diff --git a/source/common/http/access_log/access_log_impl.cc b/source/common/http/access_log/access_log_impl.cc index 1160a54768163..c4bec10a68215 100644 --- a/source/common/http/access_log/access_log_impl.cc +++ b/source/common/http/access_log/access_log_impl.cc @@ -66,14 +66,12 @@ FilterPtr FilterImpl::fromJson(Json::Object& json, Runtime::Loader& runtime) { } else if (type == "not_healthcheck") { return FilterPtr{new NotHealthCheckFilter()}; } else if (type == "traceable_request") { - return FilterPtr{new TraceableRequestFilter(runtime)}; + return FilterPtr{new TraceableRequestFilter()}; } else { throw EnvoyException(fmt::format("invalid access log filter type '{}'", type)); } } -TraceableRequestFilter::TraceableRequestFilter(Runtime::Loader& runtime) : runtime_(runtime) {} - bool TraceableRequestFilter::evaluate(const RequestInfo& info, const HeaderMap& request_headers) { Tracing::Decision decision = Tracing::HttpTracerUtility::isTracing(info, request_headers); diff --git a/source/common/http/access_log/access_log_impl.h b/source/common/http/access_log/access_log_impl.h index 6f4ce6583924f..830e7daccdd14 100644 --- a/source/common/http/access_log/access_log_impl.h +++ b/source/common/http/access_log/access_log_impl.h @@ -106,13 +106,8 @@ class NotHealthCheckFilter : public Filter { */ class TraceableRequestFilter : public Filter { public: - TraceableRequestFilter(Runtime::Loader& runtime); - // Http::AccessLog::Filter bool evaluate(const RequestInfo& info, const HeaderMap& request_headers) override; - -private: - Runtime::Loader& runtime_; }; /** diff --git a/source/common/runtime/runtime_impl.h b/source/common/runtime/runtime_impl.h index 54e28b4108840..b51c70ae5993b 100644 --- a/source/common/runtime/runtime_impl.h +++ b/source/common/runtime/runtime_impl.h @@ -146,7 +146,7 @@ class LoaderImpl : public Loader { */ class NullLoaderImpl : public Loader { public: - NullLoaderImpl(RandomGenerator& generator) : generator_(generator), snapshot_(generator) {} + NullLoaderImpl(RandomGenerator& generator) : snapshot_(generator) {} // Runtime::Loader Snapshot& snapshot() override { return snapshot_; } @@ -186,7 +186,6 @@ class NullLoaderImpl : public Loader { RandomGenerator& generator_; }; - RandomGenerator& generator_; NullSnapshotImpl snapshot_; }; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7e4ad9df33ec3..159972e64e540 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -149,6 +149,12 @@ add_executable(envoy-test test_common/printers.cc test_common/utility.cc) +# The MOCK_METHOD* macros from gtest triggers this clang warning and it's hard +# to work around, so we just ignore it. +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set_target_properties(envoy-test PROPERTIES COMPILE_FLAGS "-Wno-inconsistent-missing-override") +endif() + if (ENVOY_TCMALLOC) target_link_libraries(envoy-test tcmalloc_and_profiler) endif() diff --git a/test/common/network/filter_manager_impl_test.cc b/test/common/network/filter_manager_impl_test.cc index 7ef187d45dc77..9eb5de273df0d 100644 --- a/test/common/network/filter_manager_impl_test.cc +++ b/test/common/network/filter_manager_impl_test.cc @@ -32,14 +32,10 @@ class NetworkFilterManagerTest : public testing::Test, public BufferSource { class LocalMockFilter : public MockFilter { public: - LocalMockFilter(const Upstream::HostDescription* host) : host_(host) {} ~LocalMockFilter() { // Make sure the upstream host is still valid in the filter destructor. callbacks_->upstreamHost()->url(); } - -private: - const Upstream::HostDescription* host_; }; TEST_F(NetworkFilterManagerTest, All) { @@ -48,7 +44,7 @@ TEST_F(NetworkFilterManagerTest, All) { Upstream::HostDescription* host_description(new NiceMock()); MockReadFilter* read_filter(new MockReadFilter()); MockWriteFilter* write_filter(new MockWriteFilter()); - MockFilter* filter(new LocalMockFilter(host_description)); + MockFilter* filter(new LocalMockFilter()); NiceMock connection; FilterManagerImpl manager(connection, *this);