forked from qt-creator/qt-creator
Clang: Fix highlighting of instance with member for writable arguments
struct X
{
int member;
};
void f(int &argument);
void foo()
{
X x;
f(x.member);
}
Task-number: QTCREATORBUG-17101
Change-Id: I6746122dbe86d032b3797a01b5f2257846007f94
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -205,18 +205,15 @@ bool HighlightingMark::isArgumentInCurrentOutputArgumentLocations() const
|
||||
auto originalSourceLocation = originalCursor.cxSourceLocation();
|
||||
|
||||
const auto isNotSameOutputArgument = [&] (const CXSourceRange ¤tSourceRange) {
|
||||
return !(originalSourceLocation.int_data >= currentSourceRange.begin_int_data
|
||||
&& originalSourceLocation.int_data <= currentSourceRange.end_int_data);
|
||||
return originalSourceLocation.int_data >= currentSourceRange.begin_int_data
|
||||
&& originalSourceLocation.int_data <= currentSourceRange.end_int_data;
|
||||
};
|
||||
|
||||
auto partitionPoint = std::partition(currentOutputArgumentRanges->begin(),
|
||||
currentOutputArgumentRanges->end(),
|
||||
isNotSameOutputArgument);
|
||||
auto found = std::find_if(currentOutputArgumentRanges->begin(),
|
||||
currentOutputArgumentRanges->end(),
|
||||
isNotSameOutputArgument);
|
||||
|
||||
bool isOutputArgument = partitionPoint != currentOutputArgumentRanges->end();
|
||||
|
||||
if (isOutputArgument)
|
||||
currentOutputArgumentRanges->erase(partitionPoint, currentOutputArgumentRanges->end());
|
||||
bool isOutputArgument = found != currentOutputArgumentRanges->end();
|
||||
|
||||
return isOutputArgument;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user