MSVC: Suppress warning C4910 for exported extern templates

Warnings like the following started showing up in dev after
3c0cd7566c. 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<bool>':
'__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation

Amends 3c0cd7566c

Task-number: QTBUG-82403
Change-Id: I1ee6731afafd4636102a49555d4d892f39a21bc7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Mårten Nordheim 2020-02-21 13:48:50 +01:00
parent cf000d080c
commit e65345afb1

View File

@ -2737,6 +2737,8 @@ class QMetaTypeForType<void>
#define QT_METATYPE_DECLARE_EXTERN_TEMPLATE_ITER(TypeName, Id, Name) \
extern template class Q_CORE_EXPORT QMetaTypeForType<Name>;
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<void>
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