forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.8' into HEAD
Conflicts: src/libs/cplusplus/FindUsages.cpp tests/auto/cplusplus/findusages/tst_findusages.cpp tests/auto/debugger/tst_dumpers.cpp Change-Id: I20e2002c7b25cc25d8120922fa9b52e59db498e3
This commit is contained in:
@@ -104,6 +104,7 @@ private Q_SLOTS:
|
||||
void using_insideGlobalNamespace();
|
||||
void using_insideNamespace();
|
||||
void using_insideFunction();
|
||||
void templatedFunction_QTCREATORBUG9749();
|
||||
};
|
||||
|
||||
void tst_FindUsages::inlineMethod()
|
||||
@@ -818,5 +819,35 @@ void tst_FindUsages::templateFunctionParameters()
|
||||
QCOMPARE(findUsages.usages().size(), 4);
|
||||
}
|
||||
|
||||
void tst_FindUsages::templatedFunction_QTCREATORBUG9749()
|
||||
{
|
||||
const QByteArray src = "\n"
|
||||
"template <class IntType> char *reformatInteger(IntType value, int format) {}\n"
|
||||
"void func(int code, int format) {\n"
|
||||
" reformatInteger(code, format);"
|
||||
"}\n"
|
||||
;
|
||||
|
||||
Document::Ptr doc = Document::create("templatedFunction_QTCREATORBUG9749");
|
||||
doc->setUtf8Source(src);
|
||||
doc->parse();
|
||||
doc->check();
|
||||
|
||||
QVERIFY(doc->diagnosticMessages().isEmpty());
|
||||
QCOMPARE(doc->globalSymbolCount(), 2U);
|
||||
|
||||
Snapshot snapshot;
|
||||
snapshot.insert(doc);
|
||||
|
||||
Template *funcTempl = doc->globalSymbolAt(0)->asTemplate();
|
||||
QVERIFY(funcTempl);
|
||||
QCOMPARE(funcTempl->memberCount(), 2U);
|
||||
Function *func = funcTempl->memberAt(1)->asFunction();
|
||||
|
||||
FindUsages findUsages(src, doc, snapshot);
|
||||
findUsages(func);
|
||||
QCOMPARE(findUsages.usages().size(), 2);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_FindUsages)
|
||||
#include "tst_findusages.moc"
|
||||
|
||||
Reference in New Issue
Block a user