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:
parent
dee140a79a
commit
c549ff3fd4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user