summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-03-26 14:14:18 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-03-30 13:27:14 +0100
commit0e778b96f1f4bb0d98648fab693cb16cca451beb (patch)
treed875a8dcf56f8e245d04637f2f2a7db04d574263 /tests/auto/corelib/kernel/qobject/tst_qobject.cpp
parent7ae037bc82085c73b271d70532b858fb8d8bcef9 (diff)
tst_qobject: enable some tests for narrowing
Compilers are catching up, so some #if 0 codepaths can now be conditionally enabled. Change-Id: Ia9e87a096bc2ae4789ab390a9170d9c1eb9690d6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qobject/tst_qobject.cpp')
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp10
1 files 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);