path: root/src/corelib/arch
diff options
authorThiago Macieira <>2014-06-23 11:47:49 -0700
committerDavid Faure <>2014-06-24 18:41:45 +0200
commit00dce1cc0078f9633d121908172346cc22deb3c3 (patch)
tree732b011daf0d696cc1c4506fab1f4001934a65ae /src/corelib/arch
parent0e14a58a96fc3deb78ac152c480cac3ac907f0f7 (diff)
Make the fetchAndAddRelaxed function a member template
This way, no compiler can instantiate it at class instantiation time. We don't want them to do it for T that are function pointers (sizeof functions is meaningless). Change-Id: I6d5044bd5d9ffd0d347f1f38ab33c64213730788 Reviewed-by: Olivier Goffart <> Reviewed-by: David Faure <>
Diffstat (limited to 'src/corelib/arch')
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/arch/qatomic_bootstrap.h b/src/corelib/arch/qatomic_bootstrap.h
index 0d6843a3e5..1ab901d826 100644
--- a/src/corelib/arch/qatomic_bootstrap.h
+++ b/src/corelib/arch/qatomic_bootstrap.h
@@ -85,8 +85,8 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> >
return tmp;
- static
- T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ template <typename AdditiveType> static
+ T fetchAndAddRelaxed(T &_q_value, AdditiveType valueToAdd) Q_DECL_NOTHROW
T returnValue = _q_value;
_q_value += valueToAdd;