mirror of https://github.com/qt/qtbase.git
QPair: add compile test involving pair with contained C array
Task-number: QTBUG-48780 Change-Id: Ic53121d9251bfdc905c2ed28d1d9716a475e2f5b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
12a9d6be28
commit
5e6816114d
|
@ -42,6 +42,7 @@ class tst_QPair : public QObject
|
|||
private Q_SLOTS:
|
||||
void testConstexpr();
|
||||
void testConversions();
|
||||
void taskQTBUG_48780_pairContainingCArray();
|
||||
};
|
||||
|
||||
class C { char _[4]; };
|
||||
|
@ -166,5 +167,15 @@ void tst_QPair::testConversions()
|
|||
}
|
||||
}
|
||||
|
||||
void tst_QPair::taskQTBUG_48780_pairContainingCArray()
|
||||
{
|
||||
// compile-only:
|
||||
QPair<int[2], int> pair;
|
||||
pair.first[0] = 0;
|
||||
pair.first[1] = 1;
|
||||
pair.second = 2;
|
||||
Q_UNUSED(pair);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_QPair)
|
||||
#include "tst_qpair.moc"
|
||||
|
|
Loading…
Reference in New Issue