summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-10-14 14:05:57 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-15 23:58:46 +0200
commit704616605b571f126bce59243c8bc3be48f5ace8 (patch)
tree8a373b383aaa8c45fafbd04331bea95a51bf5295 /src/corelib/global
parent74f2a1bd472802cc93e416d2916d0e798e199515 (diff)
Remove compatibility support for sealed/override in C++/CLI
Those features have slightly different behavior as the C++11 keywords that MSVC 2012 officially supports. When compiling in C++/CLI mode, the "virtual" keyword must be present too. We have not actually tested whether the official MSVC 2012 support for C++/CLI still requires the virtual keyword. This is just going on the assumption that C++/CLI follows the C++11 spec. Task-number: QTBUG-34019 Change-Id: I148a443bfbff985033c555f5a9cfcd5be7f5f106 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index a388bdb96f..280c5066a6 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -696,15 +696,20 @@
# if _MSC_VER >= 1400
/* C++11 features supported in VC8 = VC2005: */
# define Q_COMPILER_VARIADIC_MACROS
+
+# ifndef __cplusplus_cli
/* 2005 supports the override and final contextual keywords, in
the same positions as the C++11 variants, but 'final' is
called 'sealed' instead:
http://msdn.microsoft.com/en-us/library/0w2w91tf%28v=vs.80%29.aspx
+ The behavior is slightly different in C++/CLI, which requires the
+ "virtual" keyword to be present too, so don't define for that.
So don't define Q_COMPILER_EXPLICIT_OVERRIDES (since it's not
the same as the C++11 version), but define the Q_DECL_* flags
accordingly: */
# define Q_DECL_OVERRIDE override
# define Q_DECL_FINAL sealed
+# endif
# endif
# if _MSC_VER >= 1600
/* C++11 features supported in VC10 = VC2010: */