Catch missing virtual destructors, enable g++ warnings
This commit is contained in:
parent
daf5480c48
commit
ebbcc5cbdb
@ -89,7 +89,7 @@ if(MSVC)
|
||||
add_definitions(/W4)
|
||||
add_definitions(/bigobj)
|
||||
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)
|
||||
|
@ -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<Data> 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<typename ValueType>
|
||||
Any(const ValueType &t_value)
|
||||
Any(const ValueType &t_value)
|
||||
: m_data(std::shared_ptr<Data>(new Data_Impl<ValueType>(t_value)))
|
||||
{
|
||||
m_data = std::shared_ptr<Data>(new Data_Impl<ValueType>(t_value));
|
||||
}
|
||||
|
||||
Any & operator=(const Any &t_any)
|
||||
|
@ -39,6 +39,7 @@ namespace chaiscript
|
||||
{
|
||||
public:
|
||||
virtual ~Proxy_Function_Base() {}
|
||||
|
||||
Boxed_Value operator()(const std::vector<Boxed_Value> ¶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<const Dynamic_Proxy_Function *>(&rhs);
|
||||
@ -221,9 +224,6 @@ namespace chaiscript
|
||||
&& test_guard(vals, t_conversions);
|
||||
}
|
||||
|
||||
virtual ~Dynamic_Proxy_Function() {}
|
||||
|
||||
|
||||
virtual int get_arity() const
|
||||
{
|
||||
return m_arity;
|
||||
|
Loading…
x
Reference in New Issue
Block a user