mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
Ref T773, gcc/clang warnings
Remark: "assuming signed overflow does not occur when assuming that (X - c) > X is always false"
This commit is contained in:
committed by
Mat Sutcliffe
parent
4120a2c77d
commit
466c761616
@@ -119,12 +119,21 @@ namespace BlackMisc
|
||||
//! Swap this sequence with another.
|
||||
void swap(CSequence &other) noexcept { m_impl.swap(other.m_impl); }
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-overflow"
|
||||
#endif
|
||||
|
||||
//! Access an element by its index.
|
||||
reference operator [](size_type index) { Q_ASSERT(index >= 0 && index < m_impl.size()); return m_impl[index]; }
|
||||
|
||||
//! Access an element by its index.
|
||||
const_reference operator [](size_type index) const { Q_ASSERT(index >= 0 && index < m_impl.size()); return m_impl[index]; }
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
//! Access the first element.
|
||||
reference front() { Q_ASSERT(!empty()); return m_impl.front(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user