Skip to content

Commit

Permalink
tst_qobject: enable some tests for narrowing
Browse files Browse the repository at this point in the history
Compilers are catching up, so some #if 0 codepaths can now be
conditionally enabled.

Change-Id: Ia9e87a096bc2ae4789ab390a9170d9c1eb9690d6
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
dangelog committed Mar 30, 2021
1 parent 7ae037b commit 0e778b9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/auto/corelib/kernel/qobject/tst_qobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
};
Expand All @@ -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);
Expand Down

0 comments on commit 0e778b9

Please sign in to comment.