Disable the use of "override" keyword for MSVC < 11.

While the keyword is indeed supported since MSVC 8, it's only since MSVC 11
that using it doesn't generate C4481 compiler warning ("nonstandard extension
used"), so avoid using it with the earlier versions.

See #16100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76184 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-03-23 00:56:55 +00:00
parent cc125e64b3
commit 62efdabbb8

View File

@ -276,10 +276,16 @@ typedef short int WXTYPE;
#if __cplusplus >= 201103L
/* All C++11 compilers should have it. */
#define HAVE_OVERRIDE
#elif wxCHECK_VISUALC_VERSION(8)
#elif wxCHECK_VISUALC_VERSION(11)
/*
VC++ 8.0+ do support override keyword but don't define __cplusplus
as indicating C++11 support, so handle this case specially.
VC++ supports override keyword since version 8 but doesn't define
__cplusplus as indicating C++11 support (at least up to and
including 12), so handle its case specially.
Also note that while the keyword is supported, using it with
versions 8, 9 and 10 results in C4481 compiler warning ("nonstandard
extension used") and so we avoid using it there, you could disable
this warning and predefine HAVE_OVERRIDE if you don't care about it.
*/
#define HAVE_OVERRIDE
#elif WX_HAS_CLANG_FEATURE(cxx_override_control)