diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-07-01 14:10:43 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-07-02 09:39:33 +0200 |
commit | c34242c679aaea6ee1badf6c1e5f274f925f5f50 (patch) | |
tree | ae27332e2a5bd43dd5a625b2820c2aadc0e53502 /tests/auto/corelib/tools | |
parent | fdef9c80391c23875208d8576096c0d5366fedc4 (diff) |
Make the default ctor of QVarLengthArray implicit
Otherwise "QVarLengthArray<Foo> x = {};" gives a warning. Also, some
compilers get confused about "QVarLengthArray()" this way.
Task-number: QTBUG-76199
Change-Id: I4296586c0181d3e6e82ca8b7b79aeb9a21645d1f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp index fff8c75a90..070c25368b 100644 --- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp +++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp @@ -57,6 +57,7 @@ private slots: void initializeListComplex(); void insertMove(); void nonCopyable(); + void implicitDefaultCtor(); private: template<typename T> @@ -1078,5 +1079,11 @@ void tst_QVarLengthArray::nonCopyable() QVERIFY(ptr6 == vec.at(5).get()); } +void tst_QVarLengthArray::implicitDefaultCtor() +{ + QVarLengthArray<int> def = {}; + QCOMPARE(def.size(), 0); +} + QTEST_APPLESS_MAIN(tst_QVarLengthArray) #include "tst_qvarlengtharray.moc" |