diff options
Diffstat (limited to 'tests/auto/cplusplus/semantic/tst_semantic.cpp')
-rw-r--r-- | tests/auto/cplusplus/semantic/tst_semantic.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/cplusplus/semantic/tst_semantic.cpp b/tests/auto/cplusplus/semantic/tst_semantic.cpp index 860a9940bc..bc6631a8a8 100644 --- a/tests/auto/cplusplus/semantic/tst_semantic.cpp +++ b/tests/auto/cplusplus/semantic/tst_semantic.cpp @@ -154,6 +154,7 @@ private slots: void function_declaration_2(); void function_definition_1(); void nested_class_1(); + void alias_declaration_1(); void typedef_1(); void typedef_2(); void typedef_3(); @@ -320,6 +321,25 @@ void tst_Semantic::nested_class_1() QCOMPARE(namedTy->name()->asNameId()->identifier(), objectId); } +void tst_Semantic::alias_declaration_1() +{ + QSharedPointer<Document> doc = document( + "using wobble = int;\n" + , false, false, true); + + QCOMPARE(doc->errorCount, 0U); + QCOMPARE(doc->globals->memberCount(), 1U); + + Declaration *decl = doc->globals->memberAt(0)->asDeclaration(); + QVERIFY(decl->name()); + QVERIFY(decl->name()->identifier()); + QCOMPARE(decl->name()->identifier()->chars(), "wobble"); + + QVERIFY(decl->isTypedef()); + QVERIFY(decl->type().isTypedef()); + QVERIFY(decl->type()->isIntegerType()); +} + void tst_Semantic::typedef_1() { QSharedPointer<Document> doc = document( |