C++: fix code completion: casting inside parentheses

Included unit tests.

Task-number: QTCREATORBUG-8368

Change-Id: I1b04124bc2c9eac050cfb2e6d3a5c1aca5311f4b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Przemyslaw Gorszkowski
2012-12-05 09:20:52 +01:00
committed by Erik Verbruggen
parent d9571f2ecd
commit 31ce303ee7
3 changed files with 85 additions and 0 deletions

View File

@@ -157,6 +157,8 @@ int ExpressionUnderCursor::startOfExpression_helper(BackwardsScanner &tk, int in
return index - 1;
} else if (tk[index - 1].is(T_RPAREN)) {
int matchingBraceIndex = tk.startOfMatchingBrace(index);
if (! matchingBraceIndex)
return matchingBraceIndex;
if (matchingBraceIndex != index) {
if (tk[matchingBraceIndex - 1].is(T_GREATER)) {
int lessIndex = tk.startOfMatchingBrace(matchingBraceIndex);