summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-08-12 14:14:02 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-08-14 15:52:58 +0200
commit6f0df02d002356625f10683ef84da7685d92a2c4 (patch)
tree46713209af459ebda534c3404f48c5f5c80ba3f8 /tests/auto
parent44cce1a2ea9dadd8b2de93f40de34269dda703c0 (diff)
Replace Qt CONSTEXPR defines with constexpr
Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/global/qflags/tst_qflags.cpp2
-rw-r--r--tests/auto/corelib/plugin/quuid/tst_quuid.cpp4
-rw-r--r--tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp4
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp4
-rw-r--r--tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp2
-rw-r--r--tests/auto/corelib/text/qstringview/tst_qstringview.cpp2
-rw-r--r--tests/auto/corelib/thread/qfuture/tst_qfuture.cpp2
-rw-r--r--tests/auto/corelib/thread/qmutex/tst_qmutex.cpp8
-rw-r--r--tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp10
-rw-r--r--tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp8
-rw-r--r--tests/auto/corelib/tools/qlist/tst_qlist.cpp2
-rw-r--r--tests/auto/corelib/tools/qpair/tst_qpair.cpp10
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp4
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp2
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp2
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp16
20 files changed, 46 insertions, 46 deletions
diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp
index 56319f215d..e0cc1d71f5 100644
--- a/tests/auto/corelib/global/qflags/tst_qflags.cpp
+++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp
@@ -93,7 +93,7 @@ void tst_QFlags::testFlagMultiBits() const
template <unsigned int N, typename T> bool verifyConstExpr(T n) { return n == N; }
-Q_DECL_RELAXED_CONSTEXPR Qt::MouseButtons testRelaxedConstExpr()
+constexpr Qt::MouseButtons testRelaxedConstExpr()
{
Qt::MouseButtons value;
value = Qt::LeftButton | Qt::RightButton;
diff --git a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
index 02dbdff157..c8613f5f48 100644
--- a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
+++ b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
@@ -302,8 +302,8 @@ void tst_QUuid::notEqual()
void tst_QUuid::cpp11() {
#ifdef Q_COMPILER_UNIFORM_INIT
// "{fc69b59e-cc34-4436-a43c-ee95d128b8c5}" cf, initTestCase
- Q_DECL_CONSTEXPR QUuid u1{0xfc69b59e, 0xcc34, 0x4436, 0xa4, 0x3c, 0xee, 0x95, 0xd1, 0x28, 0xb8, 0xc5};
- Q_DECL_CONSTEXPR QUuid u2 = {0xfc69b59e, 0xcc34, 0x4436, 0xa4, 0x3c, 0xee, 0x95, 0xd1, 0x28, 0xb8, 0xc5};
+ constexpr QUuid u1{0xfc69b59e, 0xcc34, 0x4436, 0xa4, 0x3c, 0xee, 0x95, 0xd1, 0x28, 0xb8, 0xc5};
+ constexpr QUuid u2 = {0xfc69b59e, 0xcc34, 0x4436, 0xa4, 0x3c, 0xee, 0x95, 0xd1, 0x28, 0xb8, 0xc5};
Q_UNUSED(u1);
Q_UNUSED(u2);
#else
diff --git a/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp b/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp
index 647a3ae379..654752f028 100644
--- a/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp
+++ b/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp
@@ -140,7 +140,7 @@ void tst_QByteArrayMatcher::indexIn()
void tst_QByteArrayMatcher::staticByteArrayMatcher()
{
{
- static Q_RELAXED_CONSTEXPR auto smatcher = qMakeStaticByteArrayMatcher("Hello");
+ static constexpr auto smatcher = qMakeStaticByteArrayMatcher("Hello");
QCOMPARE(smatcher.pattern(), QByteArrayLiteral("Hello"));
QCOMPARE(smatcher.indexIn(QByteArray("Hello, World!")), 0);
@@ -186,7 +186,7 @@ void tst_QByteArrayMatcher::staticByteArrayMatcher()
}
{
- static Q_RELAXED_CONSTEXPR auto smatcher = qMakeStaticByteArrayMatcher(LONG_STRING_256);
+ static constexpr auto smatcher = qMakeStaticByteArrayMatcher(LONG_STRING_256);
QCOMPARE(smatcher.pattern(), QByteArrayLiteral(LONG_STRING_256));
QCOMPARE(smatcher.indexIn(QByteArray("a" LONG_STRING_256)), 1);
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
index 321e9ba32e..b26381c387 100644
--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
@@ -265,8 +265,8 @@ class CharStarContainer
{
const char *str;
public:
- explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = nullptr) : str(s) {}
- Q_DECL_CONSTEXPR operator const char *() const { return str; }
+ explicit constexpr CharStarContainer(const char *s = nullptr) : str(s) {}
+ constexpr operator const char *() const { return str; }
};
} // unnamed namespace
diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
index 3e1f10cc11..2716ee2c8d 100644
--- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
+++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
@@ -82,7 +82,7 @@ MAKE_ALL(const char*, QChar)
#undef MAKE_RELOP
// END FIXME
-static Q_DECL_CONSTEXPR int sign(int i) noexcept
+static constexpr int sign(int i) noexcept
{
return i < 0 ? -1 :
i > 0 ? +1 :
diff --git a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
index 55e23570d7..a7f39412a8 100644
--- a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
+++ b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
@@ -126,7 +126,7 @@ static_assert(!CanConvert<std::list<char16_t>>::value);
// wchar_t
//
-Q_CONSTEXPR bool CanConvertFromWCharT =
+constexpr bool CanConvertFromWCharT =
#ifdef Q_OS_WIN
true
#else
diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
index cc2e2e0984..c1b562e7f4 100644
--- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
+++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
@@ -1711,7 +1711,7 @@ void tst_QFuture::nestedExceptions()
void tst_QFuture::nonGlobalThreadPool()
{
- static Q_CONSTEXPR int Answer = 42;
+ static constexpr int Answer = 42;
struct UselessTask : QRunnable, QFutureInterface<int>
{
diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
index 6603e5d7ce..b07f8196c5 100644
--- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
@@ -90,7 +90,7 @@ enum {
};
#if __has_include(<chrono>)
-static Q_CONSTEXPR std::chrono::milliseconds waitTimeAsDuration(waitTime);
+static constexpr std::chrono::milliseconds waitTimeAsDuration(waitTime);
#endif
void tst_QMutex::convertToMilliseconds_data()
@@ -164,9 +164,9 @@ void tst_QMutex::convertToMilliseconds()
QFETCH(qint64, intValue);
QFETCH(qint64, expected);
- Q_CONSTEXPR qint64 maxShort = std::numeric_limits<short>::max();
- Q_CONSTEXPR qint64 maxInt = std::numeric_limits<int>::max();
- Q_CONSTEXPR qint64 maxUInt = std::numeric_limits<uint>::max();
+ constexpr qint64 maxShort = std::numeric_limits<short>::max();
+ constexpr qint64 maxInt = std::numeric_limits<int>::max();
+ constexpr qint64 maxUInt = std::numeric_limits<uint>::max();
switch (unit) {
#define CASE(Unit, Period) \
diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index 964c68c9e9..44e6bef6f0 100644
--- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -1046,25 +1046,25 @@ void tst_QAlgorithms::binaryFindOnLargeContainer() const
#endif // QT_DEPRECATED_SINCE(5, 2)
// alternative implementation of qPopulationCount for comparison:
-static Q_DECL_CONSTEXPR const uint bitsSetInNibble[] = {
+static constexpr const uint bitsSetInNibble[] = {
0, 1, 1, 2, 1, 2, 2, 3,
1, 2, 2, 3, 2, 3, 3, 4,
};
static_assert(sizeof bitsSetInNibble / sizeof *bitsSetInNibble == 16);
-static Q_DECL_CONSTEXPR uint bitsSetInByte(quint8 byte)
+static constexpr uint bitsSetInByte(quint8 byte)
{
return bitsSetInNibble[byte & 0xF] + bitsSetInNibble[byte >> 4];
}
-static Q_DECL_CONSTEXPR uint bitsSetInShort(quint16 word)
+static constexpr uint bitsSetInShort(quint16 word)
{
return bitsSetInByte(word & 0xFF) + bitsSetInByte(word >> 8);
}
-static Q_DECL_CONSTEXPR uint bitsSetInInt(quint32 word)
+static constexpr uint bitsSetInInt(quint32 word)
{
return bitsSetInShort(word & 0xFFFF) + bitsSetInShort(word >> 16);
}
-static Q_DECL_CONSTEXPR uint bitsSetInInt64(quint64 word)
+static constexpr uint bitsSetInInt64(quint64 word)
{
return bitsSetInInt(word & 0xFFFFFFFF) + bitsSetInInt(word >> 32);
}
diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
index 8b78b34992..52464ffc15 100644
--- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
+++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
@@ -1149,7 +1149,7 @@ void tst_QArrayData::literals()
struct LiteralType {
int value;
- Q_DECL_CONSTEXPR LiteralType(int v = 0) : value(v) {}
+ constexpr LiteralType(int v = 0) : value(v) {}
};
{
@@ -1226,17 +1226,17 @@ struct CompilerHasCxx11ImplicitMoves
struct DetectConstructor
{
- Q_DECL_CONSTEXPR DetectConstructor()
+ constexpr DetectConstructor()
: constructor(DefaultConstructor)
{
}
- Q_DECL_CONSTEXPR DetectConstructor(const DetectConstructor &)
+ constexpr DetectConstructor(const DetectConstructor &)
: constructor(CopyConstructor)
{
}
- Q_DECL_CONSTEXPR DetectConstructor(DetectConstructor &&)
+ constexpr DetectConstructor(DetectConstructor &&)
: constructor(MoveConstructor)
{
}
diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
index c5ba53ad57..f0af24a96b 100644
--- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp
+++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
@@ -3094,7 +3094,7 @@ void tst_QList::fromReadOnlyData() const
{
struct LiteralType {
int value;
- Q_DECL_CONSTEXPR LiteralType(int v = 0) : value(v) {}
+ constexpr LiteralType(int v = 0) : value(v) {}
};
const LiteralType literal[] = {LiteralType(0), LiteralType(1), LiteralType(2)};
diff --git a/tests/auto/corelib/tools/qpair/tst_qpair.cpp b/tests/auto/corelib/tools/qpair/tst_qpair.cpp
index 464477d5d1..70caa055b6 100644
--- a/tests/auto/corelib/tools/qpair/tst_qpair.cpp
+++ b/tests/auto/corelib/tools/qpair/tst_qpair.cpp
@@ -174,15 +174,15 @@ void tst_QPair::structuredBindings()
void tst_QPair::testConstexpr()
{
- Q_CONSTEXPR QPair<int, double> pID = qMakePair(0, 0.0);
+ constexpr QPair<int, double> pID = qMakePair(0, 0.0);
Q_UNUSED(pID);
- Q_CONSTEXPR QPair<double, double> pDD = qMakePair(0.0, 0.0);
- Q_CONSTEXPR QPair<double, double> pDD2 = qMakePair(0, 0.0); // involes (rvalue) conversion ctor
- Q_CONSTEXPR bool equal = pDD2 == pDD;
+ constexpr QPair<double, double> pDD = qMakePair(0.0, 0.0);
+ constexpr QPair<double, double> pDD2 = qMakePair(0, 0.0); // involes (rvalue) conversion ctor
+ constexpr bool equal = pDD2 == pDD;
QVERIFY(equal);
- Q_CONSTEXPR QPair<QSize, int> pSI = qMakePair(QSize(4, 5), 6);
+ constexpr QPair<QSize, int> pSI = qMakePair(QSize(4, 5), 6);
Q_UNUSED(pSI);
}
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 8e92ed44f4..95c2c2bb70 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -2943,8 +2943,8 @@ struct Overloaded
{
return {};
}
- static const Q_CONSTEXPR uint base1Called = sizeof(std::array<int, 1>);
- static const Q_CONSTEXPR uint base2Called = sizeof(std::array<int, 2>);
+ static const constexpr uint base1Called = sizeof(std::array<int, 1>);
+ static const constexpr uint base2Called = sizeof(std::array<int, 2>);
void test()
{
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index ea11768a4b..e4708f358b 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -413,7 +413,7 @@ void tst_QImageWriter::supportsOption()
QFETCH(QString, fileName);
QFETCH(QIntList, options);
- static Q_CONSTEXPR QImageIOHandler::ImageOption allOptions[] = {
+ static constexpr QImageIOHandler::ImageOption allOptions[] = {
QImageIOHandler::Size,
QImageIOHandler::ClipRect,
QImageIOHandler::Description,
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index af687f8cf1..f96ed563d3 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -902,7 +902,7 @@ void tst_QPainterPath::testArcMoveTo_data()
QTest::addColumn<QRectF>("rect");
QTest::addColumn<qreal>("angle");
- static Q_CONSTEXPR QRectF rects[] = {
+ static constexpr QRectF rects[] = {
QRectF(100, 100, 100, 100),
QRectF(100, 100, -100, 100),
QRectF(100, 100, 100, -100),
diff --git a/tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp b/tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp
index da3270d527..d23ccedc6f 100644
--- a/tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp
@@ -116,7 +116,7 @@ void tst_QGraphicsTransform::scale()
// fuzzyCompareNonZero is a very slightly looser version of qFuzzyCompare
// for use with values that are not very close to zero
-Q_DECL_CONSTEXPR static inline bool fuzzyCompareNonZero(float p1, float p2)
+constexpr static inline bool fuzzyCompareNonZero(float p1, float p2)
{
return (qAbs(p1 - p2) <= 0.00003f * qMin(qAbs(p1), qAbs(p2)));
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h
index ed16878ecb..42e9e6e2a3 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.h
@@ -34,7 +34,7 @@
// value to add/remove has to be obtained in test run using the actual style.
struct ExpectedValueDescription {
- Q_DECL_CONSTEXPR ExpectedValueDescription(int v = 0, int sbeta = 0, int sta = 0)
+ constexpr ExpectedValueDescription(int v = 0, int sbeta = 0, int sta = 0)
: value(v)
, scrollBarExtentsToAdd(sbeta)
, spacingsToAdd(sta)
@@ -55,7 +55,7 @@ struct ExpectedValueDescription {
// Describes how often the scroll bar width/height has to be added to/removed
// from the according side of the sceneRect.
struct ScrollBarCount {
- Q_DECL_CONSTEXPR ScrollBarCount(int l = 0, int t = 0, int r = 0, int b = 0 )
+ constexpr ScrollBarCount(int l = 0, int t = 0, int r = 0, int b = 0 )
: left(l)
, top(t)
, right(r)
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
index 297e83421b..5c9134a3b0 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
@@ -49,7 +49,7 @@ static void _scrollBarRanges_addTestData(const QByteArray &style, bool styled)
const int viewWidth = 250;
const int viewHeight = 100;
- static Q_CONSTEXPR struct Data {
+ static constexpr struct Data {
const char *name;
QRectF sceneRect;
ScrollBarCount sceneRectOffsetFactors;
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index fd4ce89b56..fd1751c5e7 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -52,7 +52,7 @@ using namespace QTestPrivate;
// ItemRole has enumerators for numerical values 0..2, thus the only
// valid numerical values for storing into an ItemRole variable are 0..3:
-Q_CONSTEXPR QFormLayout::ItemRole invalidRole = QFormLayout::ItemRole(3);
+constexpr QFormLayout::ItemRole invalidRole = QFormLayout::ItemRole(3);
struct QFormLayoutTakeRowResultHolder {
QFormLayoutTakeRowResultHolder(QFormLayout::TakeRowResult result) noexcept
diff --git a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
index 89bb946be9..d307d9f9a8 100644
--- a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
+++ b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
@@ -111,20 +111,20 @@ void tst_QSizePolicy::constExpr()
/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54922 */
#if !defined(Q_CC_GNU) || defined(Q_CC_INTEL) || defined(Q_CC_CLANG) || Q_CC_GNU >= 408
// check that certain ctors are constexpr (compile-only):
- { Q_CONSTEXPR QSizePolicy sp; Q_UNUSED(sp); }
- { Q_CONSTEXPR QSizePolicy sp = QSizePolicy(); Q_UNUSED(sp); }
- { Q_CONSTEXPR QSizePolicy sp = QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); Q_UNUSED(sp); }
- { Q_CONSTEXPR QSizePolicy sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding, QSizePolicy::DefaultType);
- Q_CONSTEXPR QSizePolicy tp = sp.transposed(); Q_UNUSED(tp); }
+ { constexpr QSizePolicy sp; Q_UNUSED(sp); }
+ { constexpr QSizePolicy sp = QSizePolicy(); Q_UNUSED(sp); }
+ { constexpr QSizePolicy sp = QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); Q_UNUSED(sp); }
+ { constexpr QSizePolicy sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding, QSizePolicy::DefaultType);
+ constexpr QSizePolicy tp = sp.transposed(); Q_UNUSED(tp); }
{
// QTBUG-69983: For ControlType != QSizePolicy::DefaultType, qCountTrailingZeroBits()
// is used, which MSVC 15.8.1 does not consider constexpr due to built-ins
# if defined(QT_HAS_CONSTEXPR_BUILTINS) && (!defined(Q_CC_MSVC) || _MSC_VER < 1915)
- Q_RELAXED_CONSTEXPR auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed, QSizePolicy::CheckBox);
+ constexpr auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed, QSizePolicy::CheckBox);
# else
- Q_CONSTEXPR auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding, QSizePolicy::DefaultType);
+ constexpr auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding, QSizePolicy::DefaultType);
# endif
- Q_RELAXED_CONSTEXPR auto tp = sp.transposed(); Q_UNUSED(tp);
+ constexpr auto tp = sp.transposed(); Q_UNUSED(tp);
}
#else
QSKIP("QSizePolicy cannot be constexpr with this version of the compiler.");