Warn on non-virtual destructor if class has virtual functions

pull/16667/head
Vijay Pai 6 years ago
parent 3ee2919623
commit 9134639877
  1. 1
      Makefile
  2. 1
      build.yaml
  3. 1
      test/cpp/microbenchmarks/fullstack_fixtures.h
  4. 1
      test/cpp/microbenchmarks/helpers.h

@ -352,6 +352,7 @@ CXXFLAGS += -std=c++11
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
CXXFLAGS += -stdlib=libc++ CXXFLAGS += -stdlib=libc++
endif endif
CXXFLAGS += -Wnon-virtual-dtor
CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT
COREFLAGS += -fno-rtti -fno-exceptions COREFLAGS += -fno-rtti -fno-exceptions
LDFLAGS += -g LDFLAGS += -g

@ -5860,6 +5860,7 @@ defaults:
COREFLAGS: -fno-rtti -fno-exceptions COREFLAGS: -fno-rtti -fno-exceptions
CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1
-Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT -Wno-deprecated-declarations -Ithird_party/nanopb -DPB_FIELD_32BIT
CXXFLAGS: -Wnon-virtual-dtor
LDFLAGS: -g LDFLAGS: -g
zlib: zlib:
CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration

@ -48,6 +48,7 @@ namespace testing {
class FixtureConfiguration { class FixtureConfiguration {
public: public:
virtual ~FixtureConfiguration() {}
virtual void ApplyCommonChannelArguments(ChannelArguments* c) const { virtual void ApplyCommonChannelArguments(ChannelArguments* c) const {
c->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, INT_MAX); c->SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, INT_MAX);
c->SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, INT_MAX); c->SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, INT_MAX);

@ -63,6 +63,7 @@ extern gpr_atm gpr_now_call_count;
class TrackCounters { class TrackCounters {
public: public:
TrackCounters() { grpc_stats_collect(&stats_begin_); } TrackCounters() { grpc_stats_collect(&stats_begin_); }
virtual ~TrackCounters() {}
virtual void Finish(benchmark::State& state); virtual void Finish(benchmark::State& state);
virtual void AddLabel(const grpc::string& label); virtual void AddLabel(const grpc::string& label);
virtual void AddToLabel(std::ostream& out, benchmark::State& state); virtual void AddToLabel(std::ostream& out, benchmark::State& state);

Loading…
Cancel
Save