From 3351404c2c68a00c2f2ed1b5d1770c861dab67d0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 18 Feb 2016 22:47:31 +0100 Subject: [PATCH] Don't use wxOVERRIDE in wxDECLARE_EVENT_TABLE to avoid clang warnings If a class not using "override" for its other, not wx-related, virtual methods included wxDECLARE_EVENT_TABLE() with wxOVERRIDE inside it, it resulted in a clang -Winconsistent-missing-override warning per each virtual method without it which was very annoying. Avoid it by not using wxOVERRIDE in this macro and explicitly disabling the -Winconsistent-missing-override for the methods inside it in case the rest of the class does use "override". Notice that this also required rearranging the order of the declarations in this macro to ensure that a semicolon is still required after it. Closes https://github.com/wxWidgets/wxWidgets/pull/217 --- include/wx/event.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index b4603bab3a..0666f3c8f4 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -3973,10 +3973,12 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent& private: \ static const wxEventTableEntry sm_eventTableEntries[]; \ protected: \ + wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override) \ + const wxEventTable* GetEventTable() const; \ + wxEventHashTable& GetEventHashTable() const; \ + wxCLANG_WARNING_RESTORE(inconsistent-missing-override) \ static const wxEventTable sm_eventTable; \ - const wxEventTable* GetEventTable() const wxOVERRIDE; \ - static wxEventHashTable sm_eventHashTable; \ - wxEventHashTable& GetEventHashTable() const wxOVERRIDE + static wxEventHashTable sm_eventHashTable // N.B.: when building DLL with Borland C++ 5.5 compiler, you must initialize // sm_eventTable before using it in GetEventTable() or the compiler gives