forked from qt-creator/qt-creator
C++: added some notes regarding QTCREATORBUG-7968
Change-Id: Ia7a0e4b416ba6ef768d76595d8576262a828ae78 Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
1
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
1
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -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)
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
2
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
@@ -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();
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user