From 0e778b96f1f4bb0d98648fab693cb16cca451beb Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 26 Mar 2021 14:14:18 +0100 Subject: [PATCH] tst_qobject: enable some tests for narrowing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compilers are catching up, so some #if 0 codepaths can now be conditionally enabled. Change-Id: Ia9e87a096bc2ae4789ab390a9170d9c1eb9690d6 Reviewed-by: Tor Arne Vestbø Reviewed-by: Qt CI Bot Reviewed-by: Alexandru Croitor --- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 858a5084ac..f36a40e5df 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -7314,8 +7314,10 @@ void tst_QObject::checkArgumentsForNarrowing() FITS(ConvertingToDouble, long double); - // no compiler still implements this properly. -#if 0 + // GCC and clang don't implement this properly yet: + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99625 + // https://bugs.llvm.org/show_bug.cgi?id=49676 +#if defined(Q_CC_MSVC) // at least since VS2017 struct ConstructibleFromInt { /* implicit */ ConstructibleFromInt(int) {} }; @@ -7334,7 +7336,9 @@ void tst_QObject::checkArgumentsForNarrowing() class ForwardDeclared; FITS(ForwardDeclared, ForwardDeclared); -#if 0 // waiting for official compiler releases that implement P1957... +#if (defined(Q_CC_EXACTLY_GCC) && Q_CC_EXACTLY_GCC >= 1100) \ + || (defined(Q_CC_CLANG) && Q_CC_CLANG >= 1100) \ + || defined(Q_CC_MSVC) // at least since VS2017 { // wg21.link/P1957 NARROWS(char*, bool);