| 1921 | } |
| 1922 | |
| 1923 | void TestDUChain::testTypeAliasTemplate() |
| 1924 | { |
| 1925 | TestFile file(QStringLiteral("template <typename T> using Alias = T; using Foo = Alias<int>;"), QStringLiteral("cpp")); |
| 1926 | QVERIFY(file.parseAndWait()); |
| 1927 | |
| 1928 | DUChainReadLocker lock; |
| 1929 | QVERIFY(file.topContext()); |
| 1930 | |
| 1931 | QCOMPARE(file.topContext()->localDeclarations().size(), 2); |
| 1932 | auto templateAlias = file.topContext()->localDeclarations().first(); |
| 1933 | QVERIFY(templateAlias); |
| 1934 | #if CINDEX_VERSION_MINOR < 31 |
| 1935 | QEXPECT_FAIL("", "TypeAliasTemplate is not exposed via LibClang", Abort); |
| 1936 | #endif |
| 1937 | QVERIFY(templateAlias->isTypeAlias()); |
| 1938 | QVERIFY(templateAlias->abstractType()); |
| 1939 | QCOMPARE(templateAlias->abstractType()->toString(), QStringLiteral("Alias")); |
| 1940 | QCOMPARE(templateAlias->uses().size(), 1); |
| 1941 | QCOMPARE(templateAlias->uses().first().size(), 1); |
| 1942 | QCOMPARE(templateAlias->uses().first().first(), RangeInRevision(0, 51, 0, 56)); |
| 1943 | } |
| 1944 | |
| 1945 | void TestDUChain::testDeclarationsInsideMacroExpansion() |
| 1946 | { |
nothing calls this directly
no test coverage detected