permissions: Work around template partial specialization GCC bug

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71954

Pick-to: 6.5
Change-Id: I029f881fc44494a94c3e0233af3f3587b63ce7c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-05-24 13:08:27 +02:00
parent c968405455
commit cbc239b52b

View File

@ -36,9 +36,6 @@ class QPermission
template <typename T, typename Enable = void>
static constexpr inline bool is_permission_v = false;
template <typename T>
static constexpr inline bool is_permission_v<T, typename T::QtPermissionHelper> = true;
template <typename T>
using if_permission = std::enable_if_t<is_permission_v<T>, bool>;
public:
@ -72,6 +69,9 @@ private:
friend class QCoreApplication;
};
template <typename T>
constexpr bool QPermission::is_permission_v<T, typename T::QtPermissionHelper> = true;
#define QT_PERMISSION(ClassName) \
using QtPermissionHelper = void; \
friend class QPermission; \