From 704616605b571f126bce59243c8bc3be48f5ace8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 14 Oct 2013 14:05:57 -0700 Subject: 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 Reviewed-by: Lars Knoll --- src/corelib/global/qcompilerdetection.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/corelib/global') 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: */ -- cgit v1.2.3