Even more workaround for clang warnings about typeid() side effects.
Even after5aae7c7387
andd2c1fce24e
clang would still emit the warning in code using templates via WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImpl<T>). Silence the warning by putting the typeid() expressions into a trivial helper function with two wxAnyValueType reference arguments, so the class the macro is used in doesn't come into play (it shouldn't in the previous version of the code either, but clang apparently thought it did). Hopefully really closes #16968.
This commit is contained in:
@@ -159,15 +159,17 @@ private:
|
||||
public: \
|
||||
static bool IsSameClass(const wxAnyValueType* otherType) \
|
||||
{ \
|
||||
const wxAnyValueType& inst = *sm_instance.get(); \
|
||||
const wxAnyValueType& otherRef = *otherType; \
|
||||
return wxTypeId(inst) == wxTypeId(otherRef); \
|
||||
return AreSameClasses(*sm_instance.get(), *otherType); \
|
||||
} \
|
||||
virtual bool IsSameType(const wxAnyValueType* otherType) const wxOVERRIDE \
|
||||
{ \
|
||||
return IsSameClass(otherType); \
|
||||
} \
|
||||
private: \
|
||||
static bool AreSameClasses(const wxAnyValueType& a, const wxAnyValueType& b) \
|
||||
{ \
|
||||
return wxTypeId(a) == wxTypeId(b); \
|
||||
} \
|
||||
static wxAnyValueTypeScopedPtr sm_instance; \
|
||||
public: \
|
||||
static wxAnyValueType* GetInstance() \
|
||||
|
Reference in New Issue
Block a user