Clang: Partial fix for highlighting off output arguments

We get the source range for the parameter list and not the arguments
in the initializer list back. So we have to disable the test case.

Task-number: QTCREATORBUG-17101
Change-Id: I65ec6d111766b5728a951b024576cbf777c89728
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Marco Bubke
2016-11-23 16:10:20 +01:00
parent 99097d011e
commit 9dfa210011
3 changed files with 20 additions and 0 deletions

View File

@@ -363,6 +363,7 @@ HighlightingType HighlightingMark::punctuationKind(const Cursor &cursor)
{
switch (cursor.kind()) {
case CXCursor_DeclRefExpr: return operatorKind(cursor);
case CXCursor_Constructor:
case CXCursor_CallExpr: collectOutputArguments(cursor);
default: return HighlightingType::Invalid;
}

View File

@@ -539,3 +539,12 @@ void f31()
NonConstReferenceArgumentConstructor copy(instance);
}
struct NonConstReferenceMemberInitialization
{
NonConstReferenceMemberInitialization(int &foo)
: foo(foo)
{}
int &foo;
};

View File

@@ -1080,6 +1080,16 @@ TEST_F(HighlightingMarks, DISABLED_NonConstReferenceArgumentConstructor)
HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument));
}
TEST_F(HighlightingMarks, DISABLED_NonConstReferenceMemberInitialization)
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(546, 19));
infos[2];
ASSERT_THAT(infos[3],
HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument));
}
TEST_F(HighlightingMarks, DISABLED_EnumerationTypeDef)
{
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(424, 41));