diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 29 | ||||
-rw-r--r-- | src/corelib/thread/qbasicatomic.h | 4 |
2 files changed, 25 insertions, 8 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index c55da5c144..b4ea022227 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -451,7 +451,8 @@ * N2437 Q_COMPILER_CLASS_ENUM * N2235 Q_COMPILER_CONSTEXPR * N2343 N3276 Q_COMPILER_DECLTYPE - * N2346 Q_COMPILER_DEFAULT_DELETE_MEMBERS + * N2346 Q_COMPILER_DEFAULT_MEMBERS + * N2346 Q_COMPILER_DELETE_MEMBERS * N1986 Q_COMPILER_DELEGATING_CONSTRUCTORS * N3206 N3272 Q_COMPILER_EXPLICIT_OVERRIDES (v0.9 and above only) * N1987 Q_COMPILER_EXTERN_TEMPLATES @@ -484,7 +485,8 @@ # define Q_COMPILER_AUTO_TYPE # define Q_COMPILER_CLASS_ENUM # define Q_COMPILER_DECLTYPE -# define Q_COMPILER_DEFAULT_DELETE_MEMBERS +# define Q_COMPILER_DEFAULT_MEMBERS +# define Q_COMPILER_DELETE_MEMBERS # define Q_COMPILER_EXTERN_TEMPLATES # define Q_COMPILER_LAMBDA # define Q_COMPILER_RVALUE_REFS @@ -540,8 +542,11 @@ # if __has_feature(cxx_decltype) /* && __has_feature(cxx_decltype_incomplete_return_types) */ # define Q_COMPILER_DECLTYPE # endif -# if __has_feature(cxx_defaulted_functions) && __has_feature(cxx_deleted_functions) /* defaulted members in 3.0, deleted members in 2.9 */ -# define Q_COMPILER_DEFAULT_DELETE_MEMBERS +# if __has_feature(cxx_defaulted_functions) +# define Q_COMPILER_DEFAULT_MEMBERS +# endif +# if __has_feature(cxx_deleted_functions) +# define Q_COMPILER_DELETE_MEMBERS # endif # if __has_feature(cxx_delegating_constructors) # define Q_COMPILER_DELEGATING_CONSTRUCTORS @@ -620,7 +625,8 @@ # define Q_COMPILER_AUTO_FUNCTION # define Q_COMPILER_AUTO_TYPE # define Q_COMPILER_CLASS_ENUM -# define Q_COMPILER_DEFAULT_DELETE_MEMBERS +# define Q_COMPILER_DEFAULT_MEMBERS +# define Q_COMPILER_DELETE_MEMBERS # define Q_COMPILER_EXTERN_TEMPLATES # define Q_COMPILER_INITIALIZER_LISTS # define Q_COMPILER_UNICODE_STRINGS @@ -668,12 +674,23 @@ # define Q_NULLPTR 0 #endif -#ifdef Q_COMPILER_DEFAULT_DELETE_MEMBERS +#ifdef Q_COMPILER_DEFAULT_MEMBERS +# define Q_DECL_EQ_DEFAULT = default +#else +# define Q_DECL_EQ_DEFAULT +#endif + +#ifdef Q_COMPILER_DELETE_MEMBERS # define Q_DECL_EQ_DELETE = delete #else # define Q_DECL_EQ_DELETE #endif +// Don't break code that is already using Q_COMPILER_DEFAULT_DELETE_MEMBERS +#if defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS) +# define Q_COMPILER_DEFAULT_DELETE_MEMBERS +#endif + #ifdef Q_COMPILER_CONSTEXPR # define Q_DECL_CONSTEXPR constexpr #else diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index dd11ca8fd7..5aebb03008 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -179,7 +179,7 @@ public: T fetchAndAddOrdered(T valueToAdd) { return Ops::fetchAndAddOrdered(_q_value, valueToAdd); } -#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_DELETE_MEMBERS) +#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS) QBasicAtomicInteger() = default; constexpr QBasicAtomicInteger(T value) : _q_value(value) {} QBasicAtomicInteger(const QBasicAtomicInteger &) = delete; @@ -243,7 +243,7 @@ public: Type fetchAndAddOrdered(qptrdiff valueToAdd) { return Ops::fetchAndAddOrdered(_q_value, valueToAdd); } -#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_DELETE_MEMBERS) +#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS) QBasicAtomicPointer() = default; constexpr QBasicAtomicPointer(Type value) : _q_value(value) {} QBasicAtomicPointer(const QBasicAtomicPointer &) = delete; |