From 0032338f09fe89ba586a89da53a3e7ece3bf316f Mon Sep 17 00:00:00 2001 From: Matthieu Longo Date: Mon, 25 Jun 2018 16:03:52 +0200 Subject: [PATCH 1/2] [vs2017] warning C4265: class has virtual functions, but destructor is not virtual --- include/cucumber-cpp/internal/hook/HookRegistrar.hpp | 5 +++++ include/cucumber-cpp/internal/step/StepManager.hpp | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/cucumber-cpp/internal/hook/HookRegistrar.hpp b/include/cucumber-cpp/internal/hook/HookRegistrar.hpp index 61d6a605..afaded04 100644 --- a/include/cucumber-cpp/internal/hook/HookRegistrar.hpp +++ b/include/cucumber-cpp/internal/hook/HookRegistrar.hpp @@ -22,6 +22,11 @@ class CUCUMBER_CPP_EXPORT CallableStep { class CUCUMBER_CPP_EXPORT Hook { public: + // [Visual Studio] silence false positive "warning C4265: class has virtual + // functions, but destructor is not virtual" requiring virtual destructors + // for every class that has virtual functions. + virtual ~Hook() {} + void setTags(const std::string &csvTagNotation); virtual void invokeHook(Scenario *scenario, CallableStep *step); virtual void skipHook(); diff --git a/include/cucumber-cpp/internal/step/StepManager.hpp b/include/cucumber-cpp/internal/step/StepManager.hpp index 457ee899..6e30551c 100644 --- a/include/cucumber-cpp/internal/step/StepManager.hpp +++ b/include/cucumber-cpp/internal/step/StepManager.hpp @@ -102,6 +102,12 @@ class CUCUMBER_CPP_EXPORT InvokeResult { class CUCUMBER_CPP_EXPORT StepInfo : public boost::enable_shared_from_this { public: StepInfo(const std::string &stepMatcher, const std::string source); + + // [Visual Studio] silence false positive "warning C4265: class has virtual + // functions, but destructor is not virtual" requiring virtual destructors + // for every class that has virtual functions. + virtual ~StepInfo() {} + SingleStepMatch matches(const std::string &stepDescription) const; virtual InvokeResult invokeStep(const InvokeArgs * pArgs) const = 0; @@ -115,6 +121,11 @@ class CUCUMBER_CPP_EXPORT StepInfo : public boost::enable_shared_from_this Date: Wed, 9 Jan 2019 12:20:25 +0100 Subject: [PATCH 2/2] remove comments --- include/cucumber-cpp/internal/hook/HookRegistrar.hpp | 3 --- include/cucumber-cpp/internal/step/StepManager.hpp | 6 ------ 2 files changed, 9 deletions(-) diff --git a/include/cucumber-cpp/internal/hook/HookRegistrar.hpp b/include/cucumber-cpp/internal/hook/HookRegistrar.hpp index afaded04..f46520d3 100644 --- a/include/cucumber-cpp/internal/hook/HookRegistrar.hpp +++ b/include/cucumber-cpp/internal/hook/HookRegistrar.hpp @@ -22,9 +22,6 @@ class CUCUMBER_CPP_EXPORT CallableStep { class CUCUMBER_CPP_EXPORT Hook { public: - // [Visual Studio] silence false positive "warning C4265: class has virtual - // functions, but destructor is not virtual" requiring virtual destructors - // for every class that has virtual functions. virtual ~Hook() {} void setTags(const std::string &csvTagNotation); diff --git a/include/cucumber-cpp/internal/step/StepManager.hpp b/include/cucumber-cpp/internal/step/StepManager.hpp index 6e30551c..e6e91f50 100644 --- a/include/cucumber-cpp/internal/step/StepManager.hpp +++ b/include/cucumber-cpp/internal/step/StepManager.hpp @@ -103,9 +103,6 @@ class CUCUMBER_CPP_EXPORT StepInfo : public boost::enable_shared_from_this