tst_QPointer: ensure default-constructed objects are constinit'able
Construction from nullptr isn't, because it's using the QPointer(T*) constructor, which cannot be constexpr. Pick-to: 6.5 Change-Id: I19129a0fca5873e83d20351a909a7994399bfcce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 8b661846257670a1b8ef6b33593778c0f086c5e3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
e4f5d86f88
commit
6990f51553
@ -36,6 +36,10 @@ private slots:
|
|||||||
void constQPointer();
|
void constQPointer();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// check that nullptr QPointer construction is Q_CONSTINIT:
|
||||||
|
[[maybe_unused]] Q_CONSTINIT static QPointer<QFile> s_file1;
|
||||||
|
[[maybe_unused]] Q_CONSTINIT static QPointer<QFile> s_file2 = {};
|
||||||
|
|
||||||
void tst_QPointer::constructors()
|
void tst_QPointer::constructors()
|
||||||
{
|
{
|
||||||
QPointer<QObject> p1;
|
QPointer<QObject> p1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user