diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2014-07-15 12:37:19 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-07-22 16:43:51 +0200 |
commit | 45b1169d063321c72002dd732e920b87c219e0af (patch) | |
tree | a94302fdcc1554f63c346821a3bdb4bd57e603e2 /tests/auto/cplusplus/findusages | |
parent | d2db54b451bda4553ec171eb5802131a3a694f59 (diff) | |
download | qt-creator-45b1169d063321c72002dd732e920b87c219e0af.tar.gz |
C++: Support alignas in C++11 mode.
Change-Id: Ifa81a481bf92b5b71495a105ae292f3e9895f704
Task-number: QTCREATORBUG-9279
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'tests/auto/cplusplus/findusages')
-rw-r--r-- | tests/auto/cplusplus/findusages/tst_findusages.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp index 2235034c31..97162be99a 100644 --- a/tests/auto/cplusplus/findusages/tst_findusages.cpp +++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp @@ -115,6 +115,8 @@ private Q_SLOTS: void usingInDifferentNamespace_QTCREATORBUG7978(); void unicodeIdentifier(); + + void inAlignas(); }; void tst_FindUsages::dump(const QList<Usage> &usages) const @@ -984,5 +986,36 @@ void tst_FindUsages::unicodeIdentifier() QCOMPARE(usages.at(1).len, 7); } +void tst_FindUsages::inAlignas() +{ + const QByteArray src = "\n" + "struct One {};\n" + "struct alignas(One) Two {};\n" + ; + + Document::Ptr doc = Document::create("inAlignas"); + doc->setUtf8Source(src); + doc->parse(); + doc->check(); + + QVERIFY(doc->diagnosticMessages().isEmpty()); + QCOMPARE(doc->globalSymbolCount(), 2U); + + Snapshot snapshot; + snapshot.insert(doc); + + Class *c = doc->globalSymbolAt(0)->asClass(); + QVERIFY(c); + QCOMPARE(c->name()->identifier()->chars(), "One"); + + FindUsages find(src, doc, snapshot); + find(c); + QCOMPARE(find.usages().size(), 2); + QCOMPARE(find.usages()[0].line, 1); + QCOMPARE(find.usages()[0].col, 7); + QCOMPARE(find.usages()[1].line, 2); + QCOMPARE(find.usages()[1].col, 15); +} + QTEST_APPLESS_MAIN(tst_FindUsages) #include "tst_findusages.moc" |