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
This commit is contained in:
Vadim Zeitlin 2016-02-18 22:47:31 +01:00
parent 59def94f63
commit 3351404c2c

View File

@ -3973,10 +3973,12 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&
private: \ private: \
static const wxEventTableEntry sm_eventTableEntries[]; \ static const wxEventTableEntry sm_eventTableEntries[]; \
protected: \ 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; \ static const wxEventTable sm_eventTable; \
const wxEventTable* GetEventTable() const wxOVERRIDE; \ static wxEventHashTable sm_eventHashTable
static wxEventHashTable sm_eventHashTable; \
wxEventHashTable& GetEventHashTable() const wxOVERRIDE
// N.B.: when building DLL with Borland C++ 5.5 compiler, you must initialize // 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 // sm_eventTable before using it in GetEventTable() or the compiler gives