diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..78fa6bd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: cpp +compiler: + - gcc +script: + - mkdir build + - cd build + - cmake ../ + - make + - make test +notifications: + recipients: + - jason@emptycrate.com + email: + on_success: always + on_failure: always + diff --git a/CMakeLists.txt b/CMakeLists.txt index 96f4d51..8857466 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,7 @@ if(MSVC) # how to workaround or fix the error. So I'm disabling it globally. ADD_DEFINITIONS(/wd4503) else() - add_definitions(-Wall -Wextra -Wshadow -pedantic ${CPP11_FLAG}) + add_definitions(-Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic ${CPP11_FLAG}) if (APPLE) add_definitions(-Wno-sign-compare) diff --git a/include/chaiscript/dispatchkit/any.hpp b/include/chaiscript/dispatchkit/any.hpp index 217ce7f..75a01c0 100644 --- a/include/chaiscript/dispatchkit/any.hpp +++ b/include/chaiscript/dispatchkit/any.hpp @@ -42,6 +42,7 @@ namespace chaiscript { private: struct Data { + virtual ~Data() {} virtual void *data() = 0; virtual const std::type_info &type() const = 0; virtual std::shared_ptr clone() const = 0; @@ -56,6 +57,8 @@ namespace chaiscript { { } + virtual ~Data_Impl() {} + virtual void *data() { return &m_data; @@ -94,9 +97,9 @@ namespace chaiscript { } template - Any(const ValueType &t_value) + Any(const ValueType &t_value) + : m_data(std::shared_ptr(new Data_Impl(t_value))) { - m_data = std::shared_ptr(new Data_Impl(t_value)); } Any & operator=(const Any &t_any) diff --git a/include/chaiscript/dispatchkit/proxy_functions.hpp b/include/chaiscript/dispatchkit/proxy_functions.hpp index 6abc3aa..d5de855 100644 --- a/include/chaiscript/dispatchkit/proxy_functions.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions.hpp @@ -39,6 +39,7 @@ namespace chaiscript { public: virtual ~Proxy_Function_Base() {} + Boxed_Value operator()(const std::vector ¶ms, const chaiscript::Dynamic_Cast_Conversions &t_conversions) const { Boxed_Value bv = do_call(params, t_conversions); @@ -205,6 +206,8 @@ namespace chaiscript { } + virtual ~Dynamic_Proxy_Function() {} + virtual bool operator==(const Proxy_Function_Base &rhs) const { const Dynamic_Proxy_Function *prhs = dynamic_cast(&rhs); @@ -221,9 +224,6 @@ namespace chaiscript && test_guard(vals, t_conversions); } - virtual ~Dynamic_Proxy_Function() {} - - virtual int get_arity() const { return m_arity; diff --git a/readme.md b/readme.md index a82f916..2bd07ce 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/ChaiScript/ChaiScript.png?branch=ChaiScript_5_0_CPP_11)](https://travis-ci.org/ChaiScript/ChaiScript) + ChaiScript http://www.chaiscript.com