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.6 6.5 Change-Id: I19129a0fca5873e83d20351a909a7994399bfcce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
1cf0f8e7c3
commit
8b66184625
@ -36,6 +36,10 @@ private slots:
|
||||
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()
|
||||
{
|
||||
QPointer<QObject> p1;
|
||||
|
Loading…
Reference in New Issue
Block a user