Also check QStringView(std::nullptr_t) for constexpr'ness

Pick-to: 5.15
Change-Id: I85967caa014fa93d2cd3f26b63e4a85414f6a803
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Marc Mutz 2020-05-19 11:47:24 +02:00
parent dee140a79a
commit c549ff3fd4

View File

@ -301,6 +301,14 @@ void tst_QStringView::constExpr() const
Q_STATIC_ASSERT(sv2.isNull());
Q_STATIC_ASSERT(sv2.empty());
}
{
constexpr QStringView sv = nullptr;
Q_STATIC_ASSERT(sv.size() == 0);
Q_STATIC_ASSERT(sv.isNull());
Q_STATIC_ASSERT(sv.empty());
Q_STATIC_ASSERT(sv.isEmpty());
Q_STATIC_ASSERT(sv.utf16() == nullptr);
}
{
constexpr QStringView sv = u"";
Q_STATIC_ASSERT(sv.size() == 0);