From 2ece977ed7d3ef87912d233a74dd32ed01021ea3 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 14 Oct 2019 09:08:13 -0700 Subject: [PATCH] Add copy ctor for wxUniCharRef It just does the default, but C++11 deprecates having copy assignment operator without copy ctor. Eliminates many GCC -Wdeprecated-copy warnings. --- include/wx/unichar.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/wx/unichar.h b/include/wx/unichar.h index 43f8cc985e..07dda658dd 100644 --- a/include/wx/unichar.h +++ b/include/wx/unichar.h @@ -267,6 +267,12 @@ public: wxUniCharRef& operator=(const wxUniCharRef& c) { if (&c != this) *this = c.UniChar(); return *this; } +#if wxUSE_UNICODE_UTF8 + wxUniCharRef(const wxUniCharRef& that) : m_str(that.m_str), m_pos(that.m_pos) { } +#else + wxUniCharRef(const wxUniCharRef& that) : m_pos(that.m_pos) { } +#endif + #define wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL(type) \ wxUniCharRef& operator=(type c) { return *this = wxUniChar(c); } wxDO_FOR_CHAR_INT_TYPES(wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL)