forked from qt-creator/qt-creator
CppEditor: Fix triggering AssignToLocalVariable
Do not trigger for functions inside a function call. Task-number: QTCREATORBUG-9510 Change-Id: I908483fe80ff3ac0f737b21061375e206c1b1d1d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
bd7150ab89
commit
d2faf880f3
@@ -4227,6 +4227,8 @@ void AssignToLocalVariable::match(const CppQuickFixInterface &interface, QuickFi
|
||||
return;
|
||||
if (path.at(i - 1)->asReturnStatement())
|
||||
return;
|
||||
if (path.at(i - 1)->asCall())
|
||||
return;
|
||||
}
|
||||
|
||||
if (MemberAccessAST *member = path.at(i + 1)->asMemberAccess()) { // member
|
||||
@@ -4259,7 +4261,9 @@ void AssignToLocalVariable::match(const CppQuickFixInterface &interface, QuickFi
|
||||
return;
|
||||
if (path.at(idx)->asMemInitializer())
|
||||
return;
|
||||
if (path.at(i-1)->asReturnStatement())
|
||||
if (path.at(i - 1)->asReturnStatement())
|
||||
return;
|
||||
if (path.at(i - 1)->asCall())
|
||||
return;
|
||||
}
|
||||
if (NamedTypeSpecifierAST *ts = path.at(i + 2)->asNamedTypeSpecifier()) {
|
||||
|
||||
Reference in New Issue
Block a user