From 9634579408084136569a10f3a0897eb3ccd5ef79 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 27 Dec 2022 16:57:23 +0100 Subject: [PATCH] QTypeInfo: fix pointer detection Although redudant, people are allowed to use Q_DECLARE_TYPEINFO on a pointer type. There's no reason to mis-detect the isPointer trait in that case. Change-Id: Ic116f24397c91f5a3d31f5d8ee9fa2e587823257 Reviewed-by: Thiago Macieira Reviewed-by: Fabian Kosmale (cherry picked from commit 114b94c26e990c792f2735b1104dd094ada714f6) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qtypeinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 4602257ff5f..4165fe0a798 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -143,7 +143,7 @@ public: \ enum { \ isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0) && !std::is_trivial_v, \ isRelocatable = !isComplex || ((FLAGS) & Q_RELOCATABLE_TYPE) || qIsRelocatable, \ - isPointer = false, \ + isPointer = std::is_pointer_v< TYPE >, \ isIntegral = std::is_integral< TYPE >::value, \ isValueInitializationBitwiseZero = qIsValueInitializationBitwiseZero, \ }; \