diff options
author | Tim Blechmann <tim@klingt.org> | 2023-02-18 09:27:26 +0800 |
---|---|---|
committer | Tim Blechmann <tim@klingt.org> | 2023-02-22 09:05:24 +0800 |
commit | aecaf09913771e823575b8b382070a3eaa8aeae6 (patch) | |
tree | 5c18e3a7b14f6a8f398f054368d80df81108c5ca | |
parent | cdbec041e27fef1a70271c50edfc5b83ccc6cce8 (diff) | |
download | qtbase-aecaf09913771e823575b8b382070a3eaa8aeae6.tar.gz |
corelib: silence `-Wcomma` with clang-12
clang-12 warns with -Wcomma
warning: possible misuse of comma operator here [-Wcomma]
{ return Q_ASSERT(i >= 0), Q_ASSERT(i < size()), QLatin1Char(m_data[i]);
}
Change-Id: Ice8a809c8ac9069e55aedefa71faf06385e97789
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c24f4d2c32b475a24250ff4bed15837615f33ef0)
-rw-r--r-- | src/corelib/text/qstring.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 7de4e2016c..a0c546e1f5 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -105,7 +105,11 @@ public: [[nodiscard]] inline QString arg(Args &&...args) const; [[nodiscard]] constexpr QLatin1Char at(qsizetype i) const - { return Q_ASSERT(i >= 0), Q_ASSERT(i < size()), QLatin1Char(m_data[i]); } + { + Q_ASSERT(i >= 0); + Q_ASSERT(i < size()); + return QLatin1Char(m_data[i]); + } [[nodiscard]] constexpr QLatin1Char operator[](qsizetype i) const { return at(i); } [[nodiscard]] constexpr QLatin1Char front() const { return at(0); } |