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> Change-Id: I6f23ab9fb2e8ceecaa45ffaef1fadbc7de266803 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit c1f1523047b2e005fb7442847c2aa000faa7d0ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
409bfca890
commit
c8a0f5dd75
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user