summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-01 08:27:57 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-09-03 05:11:40 +0000
commit2a6bea7a55308776a76cef838f307e272f23f406 (patch)
tree66c1fcee15d803727be93540b1e0135dee800677 /src
parent312d08b290d079f5d72d9afc14a47606ebdde240 (diff)
qcompilerdetection.h: retract Q_COMPILER_DEFAULT_MEMBERS for MSVC < 2015
Earlier versions of the compiler cannot default move special member functions, even though we also define Q_COMPILER_RVALUE_REFS for them. Fix by retracting the less-often-used of the two compiler feature defines. Q_COMPILER_DEFAULT_MEMBERS is not used outside QtBase in neither 5.6 nor 5.7 (5.8 is not released at this time, so wasn't considered). The same is true of the dependent macros Q_COMPILER_DEFAULT_DELETE_MEMBERS and Q_DECL_EQ_DEFAULT. In QtBase, the three uses are: 1. in QAtomic*, where the user also requires Q_COMPILER_CONSTEXPR, which is not defined for any MSVC at this time, 2. for QEnableSharedFromThis, which is a class template with an alternative {} implementa- tion of the default constructor, and uncon- ditional user-defined copy special member functions. 3. The test of the corresponding functionality in tst_compiler, which this commit amends. That means that neither of these two only uses of the macro in Qt libraries are affected by the change. The reason we do this change, then, is that in the future, we want to be able to more easily restore move special member functions for classes for which they are suppressed due to user-defined dtors or copy special member functions. Change-Id: I6f88cad66d6b87a758231f16355c3bddae697b86 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qcompilerdetection.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 2d9e0463b7..e324c043af 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -887,7 +887,8 @@
# endif /* VC 11 */
# if _MSC_VER >= 1800
/* C++11 features in VC12 = VC2013 */
-# define Q_COMPILER_DEFAULT_MEMBERS
+/* Implemented, but can't be used on move special members */
+/* # define Q_COMPILER_DEFAULT_MEMBERS */
# define Q_COMPILER_DELETE_MEMBERS
# define Q_COMPILER_DELEGATING_CONSTRUCTORS
# define Q_COMPILER_EXPLICIT_CONVERSIONS
@@ -905,6 +906,7 @@
# endif /* VC 12 SP 2 RC */
# if _MSC_VER >= 1900
/* C++11 features in VC14 = VC2015 */
+# define Q_COMPILER_DEFAULT_MEMBERS
# define Q_COMPILER_ALIGNAS
# define Q_COMPILER_ALIGNOF
// Partial support, insufficient for Qt