summaryrefslogtreecommitdiff
path: root/src/corelib/global/qflags.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-02-25 18:16:04 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-02-28 23:09:31 +0100
commit6f50e54138f9a2aa9ab6d84add449f197d545de3 (patch)
tree7ef6c616f57bea09ee4090c7256dbed40f172730 /src/corelib/global/qflags.h
parent324887779d272364a1dfa32bb0a2a46a71a839e8 (diff)
downloadqtbase-6f50e54138f9a2aa9ab6d84add449f197d545de3.tar.gz
QFlags: fix missing bitwise xor operators in QT_TYPESAFE_FLAGS builds
Add tests that cover them. Pick-to: 6.3 Fixes: QTBUG-101300 Change-Id: I5a8af4a91d796cc4d287b813bd5cc13da3d7e766 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qflags.h')
-rw-r--r--src/corelib/global/qflags.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index 7f96d900fb..5e27ea9304 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -233,6 +233,10 @@ constexpr inline QFlags<Flags::enum_type> operator&(Flags::enum_type f1, Flags::
{ return QFlags<Flags::enum_type>(f1) & f2; } \
constexpr inline QFlags<Flags::enum_type> operator&(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept \
{ return f2 & f1; } \
+constexpr inline QFlags<Flags::enum_type> operator^(Flags::enum_type f1, Flags::enum_type f2) noexcept \
+{ return QFlags<Flags::enum_type>(f1) ^ f2; } \
+constexpr inline QFlags<Flags::enum_type> operator^(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept \
+{ return f2 ^ f1; } \
constexpr inline void operator+(Flags::enum_type f1, Flags::enum_type f2) noexcept = delete; \
constexpr inline void operator+(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept = delete; \
constexpr inline void operator+(int f1, QFlags<Flags::enum_type> f2) noexcept = delete; \