From e65345afb127b21cdc80752ace498bd3fe853577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 21 Feb 2020 13:48:50 +0100 Subject: MSVC: Suppress warning C4910 for exported extern templates Warnings like the following started showing up in dev after 3c0cd7566cf858d0fd23fecad5ef9faec798cf5f. Not a problem in CI but it is treated as an error in develop-builds, suppress them for now since it still manages to build. warning C4910: 'QtPrivate::QMetaTypeForType': '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation Amends 3c0cd7566cf858d0fd23fecad5ef9faec798cf5f Task-number: QTBUG-82403 Change-Id: I1ee6731afafd4636102a49555d4d892f39a21bc7 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qmetatype.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib/kernel/qmetatype.h') diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 424065d247..56b2474d04 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -2737,6 +2737,8 @@ class QMetaTypeForType #define QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER(TypeName, Id, Name) \ extern template class Q_CORE_EXPORT QMetaTypeForType; QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4910) // '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation +QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wattributes") // false positive because of QMetaTypeForType QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER) QT_WARNING_POP @@ -2744,6 +2746,7 @@ QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER) QT_FOR_EACH_STATIC_CORE_CLASS(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER) QT_FOR_EACH_STATIC_CORE_POINTER(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER) QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER) +QT_WARNING_POP #undef QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER #endif -- cgit v1.2.3