summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-04-23 07:49:44 +0200
committerMarc Mutz <marc.mutz@qt.io>2024-04-23 13:24:42 +0000
commitc1f1523047b2e005fb7442847c2aa000faa7d0ac (patch)
treecfb9d0b56655994da17d04f53b4e58ce34d9cd9f /src/corelib
parent2574424d7a557c0add529d897ff5daeda4db4624 (diff)
QAtomicScopedValueRollback: remove impossible constexpr
Neither atomic::load() nor store() are contstexpr in the standard. The only reason this code compiled is because QASVR is a class template, so contexpr tags that can't be fulfilled are silently dropped at instantiation time by the compiler. Remove the tag to avoid giving readers the wrong idea. Reported-by: Thiago Macieira <thiago.macieira@intel.com> Pick-to: 6.7 Change-Id: I6f23ab9fb2e8ceecaa45ffaef1fadbc7de266803 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qatomicscopedvaluerollback.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/tools/qatomicscopedvaluerollback.h b/src/corelib/tools/qatomicscopedvaluerollback.h
index 41e919a3c6..8f653acba5 100644
--- a/src/corelib/tools/qatomicscopedvaluerollback.h
+++ b/src/corelib/tools/qatomicscopedvaluerollback.h
@@ -104,15 +104,12 @@ public:
std::memory_order mo = std::memory_order_seq_cst)
: QAtomicScopedValueRollback(var._q_value, value, mo) {}
-#if __cpp_constexpr >= 201907L
- constexpr
-#endif
~QAtomicScopedValueRollback()
{
m_atomic.store(m_value, store_part(m_mo));
}
- constexpr void commit()
+ void commit()
{
m_value = m_atomic.load(load_part(m_mo));
}