Suppress -Wsuggest-override warnings in user code for gcc too

This was already done for clang -Winconsistent-missing-override, but
gcc has a similar warning since 5.1 and, moreover, latest versions of
clang support this gcc warning as well, so add a special macro which
handles both compilers and use it in all wx macros defining virtual
functions instead of just disabling one of the clang warnings.

Closes https://github.com/wxWidgets/wxWidgets/pull/2000
This commit is contained in:
Teodor Petrov
2020-07-27 00:00:35 +03:00
committed by Vadim Zeitlin
parent 19db07d668
commit c924ecb10a
4 changed files with 29 additions and 7 deletions

View File

@@ -140,9 +140,9 @@ WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
#define wxDECLARE_ABSTRACT_CLASS(name) \
public: \
static wxClassInfo ms_classInfo; \
wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override) \
virtual wxClassInfo *GetClassInfo() const \
wxCLANG_WARNING_RESTORE(inconsistent-missing-override)
wxWARNING_SUPPRESS_MISSING_OVERRIDE() \
virtual wxClassInfo *GetClassInfo() const; \
wxWARNING_RESTORE_MISSING_OVERRIDE()
#define wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \
wxDECLARE_NO_ASSIGN_CLASS(name); \