build: Add warning for non-virtual destructor and fix discovered issues

Change-Id: I1d67b9b63d84d8524580e80ac06c3efef860c56a
This commit is contained in:
Alexander Afanasyev
2017-09-21 18:57:30 -04:00
parent b5220706c6
commit 847de408cb
6 changed files with 26 additions and 9 deletions
+2
View File
@@ -136,6 +136,7 @@ class GccBasicFlags(CompilerFlags):
'-Wall',
'-Wextra',
'-Werror',
'-Wnon-virtual-dtor',
'-Wno-error=deprecated-declarations', # Bug #3795
'-Wno-error=maybe-uninitialized', # Bug #1615
'-Wno-unused-parameter',
@@ -150,6 +151,7 @@ class GccBasicFlags(CompilerFlags):
'-pedantic',
'-Wall',
'-Wextra',
'-Wnon-virtual-dtor',
'-Wno-unused-parameter',
]
flags['LINKFLAGS'] += ['-fuse-ld=gold', '-Wl,-O1']
+4 -1
View File
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
/*
* Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
@@ -37,6 +37,9 @@ namespace face {
class InternalTransportBase
{
public:
virtual
~InternalTransportBase() = default;
/** \brief causes the transport to receive a link-layer packet
*/
virtual void
+8 -5
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2014-2016, Regents of the University of California,
/*
* Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -139,6 +139,9 @@ public:
explicit
EnumerationImpl(const NameTree& nt);
virtual
~EnumerationImpl() = default;
virtual void
advance(Iterator& i) = 0;
@@ -154,7 +157,7 @@ class FullEnumerationImpl : public EnumerationImpl
public:
FullEnumerationImpl(const NameTree& nt, const EntrySelector& pred);
virtual void
void
advance(Iterator& i) override;
private:
@@ -171,7 +174,7 @@ class PartialEnumerationImpl : public EnumerationImpl
public:
PartialEnumerationImpl(const NameTree& nt, const EntrySubTreeSelector& pred);
virtual void
void
advance(Iterator& i) override;
private:
@@ -188,7 +191,7 @@ public:
PrefixMatchImpl(const NameTree& nt, const EntrySelector& pred);
private:
virtual void
void
advance(Iterator& i) override;
private:
+4 -1
View File
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
/*
* Copyright (c) 2014-2017, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
@@ -45,6 +45,9 @@ struct ReadvertiseAction
class ReadvertisePolicy : noncopyable
{
public:
virtual
~ReadvertisePolicy() = default;
/** \brief decide whether to readvertise a route, and what prefix to readvertise
*/
virtual ndn::optional<ReadvertiseAction>
+5 -2
View File
@@ -26,11 +26,11 @@
#ifndef NFD_TESTS_TOOLS_MOCK_NFD_MGMT_FIXTURE_HPP
#define NFD_TESTS_TOOLS_MOCK_NFD_MGMT_FIXTURE_HPP
#include <ndn-cxx/util/dummy-client-face.hpp>
#include "tests/test-common.hpp"
#include "tests/identity-management-fixture.hpp"
#include <ndn-cxx/util/dummy-client-face.hpp>
namespace nfd {
namespace tools {
namespace tests {
@@ -56,6 +56,9 @@ protected:
});
}
virtual
~MockNfdMgmtFixture() = default;
protected: // ControlCommand
/** \brief check the Interest is a command with specified prefix
* \retval nullopt last Interest is not the expected command
+3
View File
@@ -45,6 +45,9 @@ class Procedure : noncopyable
public:
Procedure(Face& face, KeyChain& keyChain);
virtual
~Procedure() = default;
void
initialize(const Options& options);