Commit e72be772 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

C++: added some notes regarding QTCREATORBUG-7968



Change-Id: Ia7a0e4b416ba6ef768d76595d8576262a828ae78
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 08586809
......@@ -1069,6 +1069,7 @@ void Bind::capture(CaptureAST *ast)
if (! ast)
return;
// See QTCREATORBUG-7968
}
bool Bind::visit(LambdaDeclaratorAST *ast)
......
......@@ -6296,6 +6296,8 @@ bool Parser::parseLambdaCapture(LambdaCaptureAST *&node)
bool Parser::parseCapture(CaptureAST *&)
{
// See QTCREATORBUG-7968
DEBUG_THIS_RULE();
if (LA() == T_IDENTIFIER) {
consumeToken();
......
......@@ -869,6 +869,7 @@ void FindUsages::capture(CaptureAST *ast)
if (! ast)
return;
// See QTCREATORBUG-7968
}
bool FindUsages::visit(LambdaDeclaratorAST *ast)
......
......@@ -77,6 +77,7 @@ class tst_FindUsages: public QObject
private Q_SLOTS:
void inlineMethod();
// void lambdaArg();
// Qt keywords
void qproperty_1();
......@@ -123,6 +124,40 @@ void tst_FindUsages::inlineMethod()
QCOMPARE(findUsages.references().size(), 2);
}
#if 0 /* see QTCREATORBUG-7968 */
void tst_FindUsages::lambdaArg()
{
const QByteArray src = "\n"
"void f() {\n"
" int test;\n"
" [test] { ++test; };\n"
"}\n";
Document::Ptr doc = Document::create("lambdaArg");
doc->setUtf8Source(src);
doc->parse();
doc->check();
QVERIFY(doc->diagnosticMessages().isEmpty());
QCOMPARE(doc->globalSymbolCount(), 1U);
Snapshot snapshot;
snapshot.insert(doc);
Function *f = doc->globalSymbolAt(0)->asFunction();
QVERIFY(f);
QCOMPARE(f->memberCount(), 1U);
Block *b = f->memberAt(0)->asBlock();
QCOMPARE(b->memberCount(), 2U);
Declaration *d = b->memberAt(0)->asDeclaration();
QVERIFY(d);
QCOMPARE(d->name()->identifier()->chars(), "test");
FindUsages findUsages(src, doc, snapshot);
findUsages(d);
QCOMPARE(findUsages.usages().size(), 3);
}
#endif
#if 0
@interface Clazz {} +(void)method:(int)arg; @end
@implementation Clazz +(void)method:(int)arg {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment