diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-02-25 18:16:04 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-03 02:08:57 +0000 |
commit | 0cd6d6d40d25dba63ff54098c4be7dace843a2d1 (patch) | |
tree | 792a9e687b3d24f6b67a786777bb39c874de3034 /src | |
parent | a9bf75bece1325f0e7f83056cc5c6c7468926586 (diff) |
QFlags: fix missing bitwise xor operators in QT_TYPESAFE_FLAGS builds
Add tests that cover them.
Fixes: QTBUG-101300
Change-Id: I5a8af4a91d796cc4d287b813bd5cc13da3d7e766
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f50e54138f9a2aa9ab6d84add449f197d545de3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qflags.h | 4 |
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; \ |