diff --git a/include/wx/any.h b/include/wx/any.h index 8eba4480ab..44df288bb9 100644 --- a/include/wx/any.h +++ b/include/wx/any.h @@ -159,7 +159,8 @@ private: public: \ static bool IsSameClass(const wxAnyValueType* otherType) \ { \ - return wxTypeId(*sm_instance.get()) == wxTypeId(*otherType); \ + const wxAnyValueType* const inst = sm_instance.get(); \ + return wxTypeId(*inst) == wxTypeId(*otherType); \ } \ virtual bool IsSameType(const wxAnyValueType* otherType) const \ { \