diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-09-04 23:23:20 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-05 09:48:22 +0200 |
commit | 6b7a841cb45a41f246040d01353dfeed38e0c99b (patch) | |
tree | 5386f4e180dfc9b99a3f893fad4c2d2ea0c0539a /src/corelib/kernel/qmetatype.h | |
parent | 3f6ed5566fcfbbba4cadfade460460f8ebf06ad3 (diff) |
Fix Clang 3.3 warning on using an undefined inline function
Clang doesn't like forward-declared inline functions.
qmetatype.h:70:29: error: inline function
'qMetaTypeId<QtMetaTypePrivate::QPairVariantInterfaceImpl>' is not defined [-Werror,-Wundefined-inline]
inline Q_DECL_CONSTEXPR int qMetaTypeId();
^
qmetatype.h:1463:30: note: used here
const int toId = qMetaTypeId<QtMetaTypePrivate::QPairVariantInterfaceImpl>();
^
Change-Id: I1454af5cce56512f0b3d63cfaf51a536207fc511
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qmetatype.h')
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 005199080d..87d730096b 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -1458,18 +1458,7 @@ namespace QtPrivate template<typename T> struct IsMetaTypePair<T, true> { - static bool registerConverter(int id) - { - const int toId = qMetaTypeId<QtMetaTypePrivate::QPairVariantInterfaceImpl>(); - if (!QMetaType::hasRegisteredConverterFunction(id, toId)) { - static const QtMetaTypePrivate::QPairVariantInterfaceConvertFunctor<T> o; - static const QtPrivate::ConverterFunctor<T, - QtMetaTypePrivate::QPairVariantInterfaceImpl, - QtMetaTypePrivate::QPairVariantInterfaceConvertFunctor<T> > f(o); - return QMetaType::registerConverterFunction(&f, id, toId); - } - return true; - } + inline static bool registerConverter(int id); }; template<typename T> @@ -1978,6 +1967,21 @@ Q_DECLARE_METATYPE(QtMetaTypePrivate::QPairVariantInterfaceImpl) QT_BEGIN_NAMESPACE +template <typename T> +inline bool QtPrivate::IsMetaTypePair<T, true>::registerConverter(int id) +{ + const int toId = qMetaTypeId<QtMetaTypePrivate::QPairVariantInterfaceImpl>(); + if (!QMetaType::hasRegisteredConverterFunction(id, toId)) { + static const QtMetaTypePrivate::QPairVariantInterfaceConvertFunctor<T> o; + static const QtPrivate::ConverterFunctor<T, + QtMetaTypePrivate::QPairVariantInterfaceImpl, + QtMetaTypePrivate::QPairVariantInterfaceConvertFunctor<T> > f(o); + return QMetaType::registerConverterFunction(&f, id, toId); + } + return true; +} + + #ifndef Q_QDOC template<typename T> #endif |