From d2c1fce24e955d25f2645e827669e67372024135 Mon Sep 17 00:00:00 2001 From: Jan van Dijk Date: Wed, 3 Jun 2015 17:11:29 +0200 Subject: [PATCH] Further work around for clang warnings about typeid() side effects. Apparently in some versions of the compiler even simply dereferencing a pointer inside typeid() still provokes -Wpotentially-evaluated-expression. Avoid this by dereferencing it outside and only using typeid() with references. Closes #16968. --- include/wx/any.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/wx/any.h b/include/wx/any.h index 44df288bb9..7670b12fef 100644 --- a/include/wx/any.h +++ b/include/wx/any.h @@ -159,8 +159,9 @@ private: public: \ static bool IsSameClass(const wxAnyValueType* otherType) \ { \ - const wxAnyValueType* const inst = sm_instance.get(); \ - return wxTypeId(*inst) == wxTypeId(*otherType); \ + const wxAnyValueType& inst = *sm_instance.get(); \ + const wxAnyValueType& otherRef = *otherType; \ + return wxTypeId(inst) == wxTypeId(otherRef); \ } \ virtual bool IsSameType(const wxAnyValueType* otherType) const \ { \