C++: added some notes regarding QTCREATORBUG-7968

Change-Id: Ia7a0e4b416ba6ef768d76595d8576262a828ae78
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
Erik Verbruggen
2012-10-04 16:00:24 +02:00
parent 0858680917
commit e72be772c5
4 changed files with 39 additions and 0 deletions

View File

@@ -1069,6 +1069,7 @@ void Bind::capture(CaptureAST *ast)
if (! ast) if (! ast)
return; return;
// See QTCREATORBUG-7968
} }
bool Bind::visit(LambdaDeclaratorAST *ast) bool Bind::visit(LambdaDeclaratorAST *ast)

View File

@@ -6296,6 +6296,8 @@ bool Parser::parseLambdaCapture(LambdaCaptureAST *&node)
bool Parser::parseCapture(CaptureAST *&) bool Parser::parseCapture(CaptureAST *&)
{ {
// See QTCREATORBUG-7968
DEBUG_THIS_RULE(); DEBUG_THIS_RULE();
if (LA() == T_IDENTIFIER) { if (LA() == T_IDENTIFIER) {
consumeToken(); consumeToken();

View File

@@ -869,6 +869,7 @@ void FindUsages::capture(CaptureAST *ast)
if (! ast) if (! ast)
return; return;
// See QTCREATORBUG-7968
} }
bool FindUsages::visit(LambdaDeclaratorAST *ast) bool FindUsages::visit(LambdaDeclaratorAST *ast)

View File

@@ -77,6 +77,7 @@ class tst_FindUsages: public QObject
private Q_SLOTS: private Q_SLOTS:
void inlineMethod(); void inlineMethod();
// void lambdaArg();
// Qt keywords // Qt keywords
void qproperty_1(); void qproperty_1();
@@ -123,6 +124,40 @@ void tst_FindUsages::inlineMethod()
QCOMPARE(findUsages.references().size(), 2); 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 #if 0
@interface Clazz {} +(void)method:(int)arg; @end @interface Clazz {} +(void)method:(int)arg; @end
@implementation Clazz +(void)method:(int)arg { @implementation Clazz +(void)method:(int)arg {