forked from qt-creator/qt-creator
CPlusPlus: Allow empty initializer lists in placement new
Fixes: QTCREATORBUG-30798 Change-Id: Ib9945e4e721aca5f88665bd8a289ae3c54c69e65 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -113,6 +113,7 @@ private slots:
|
||||
void templated_dtor_4();
|
||||
void templated_dtor_5();
|
||||
void emptyMemberInitialization();
|
||||
void placementNewWithEmptyConstructorArgs();
|
||||
|
||||
// possible declaration-or-expression statements
|
||||
void call_call_1();
|
||||
@@ -2070,6 +2071,15 @@ void tst_AST::emptyMemberInitialization()
|
||||
QCOMPARE(diag.errorCount, 0);
|
||||
}
|
||||
|
||||
void tst_AST::placementNewWithEmptyConstructorArgs()
|
||||
{
|
||||
const std::shared_ptr<TranslationUnit> unit(parse(
|
||||
"int main()\n{ int* i = new int;\n i = new(i) int();}",
|
||||
TranslationUnit::ParseTranlationUnit));
|
||||
QVERIFY(unit->ast());
|
||||
QCOMPARE(diag.errorCount, 0);
|
||||
}
|
||||
|
||||
void tst_AST::initTestCase()
|
||||
{
|
||||
control.setDiagnosticClient(&diag);
|
||||
|
||||
Reference in New Issue
Block a user