forked from qt-creator/qt-creator
CPlusPlus: Allow empty argument list in member initialization
Fixes: QTCREATORBUG-30797 Change-Id: I6de0f05e071a5e73317d7a8e3d035e23e23a41aa Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -112,6 +112,7 @@ private slots:
|
||||
void templated_dtor_3();
|
||||
void templated_dtor_4();
|
||||
void templated_dtor_5();
|
||||
void emptyMemberInitialization();
|
||||
|
||||
// possible declaration-or-expression statements
|
||||
void call_call_1();
|
||||
@@ -2061,6 +2062,14 @@ void tst_AST::invalidFunctionInitializer()
|
||||
QVERIFY(diag.errorCount != 0);
|
||||
}
|
||||
|
||||
void tst_AST::emptyMemberInitialization()
|
||||
{
|
||||
const std::shared_ptr<TranslationUnit> unit(parse(
|
||||
"struct S\n{\n S(): i() {}\n int i;};", TranslationUnit::ParseTranlationUnit));
|
||||
QVERIFY(unit->ast());
|
||||
QCOMPARE(diag.errorCount, 0);
|
||||
}
|
||||
|
||||
void tst_AST::initTestCase()
|
||||
{
|
||||
control.setDiagnosticClient(&diag);
|
||||
|
||||
Reference in New Issue
Block a user