diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 3e32a4815a..a9b412b7b1 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1173,7 +1173,6 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1); #ifdef Q_QDOC - // Just for documentation generation template auto qOverload(T functionPointer); @@ -1181,9 +1180,7 @@ template auto qConstOverload(T memberFunctionPointer); template auto qNonConstOverload(T memberFunctionPointer); - -#elif defined(Q_COMPILER_VARIADIC_TEMPLATES) - +#else template struct QNonConstOverload { @@ -1225,12 +1222,9 @@ struct QOverload : QConstOverload, QNonConstOverload { return ptr; } }; -#if defined(__cpp_variable_templates) && __cpp_variable_templates >= 201304 // C++14 -template [[maybe_unused]] constexpr QOverload qOverload = {}; -template [[maybe_unused]] constexpr QConstOverload qConstOverload = {}; -template [[maybe_unused]] constexpr QNonConstOverload qNonConstOverload = {}; -#endif - +template [[maybe_unused]] constexpr inline QOverload qOverload = {}; +template [[maybe_unused]] constexpr inline QConstOverload qConstOverload = {}; +template [[maybe_unused]] constexpr inline QNonConstOverload qNonConstOverload = {}; #endif