forked from qt-creator/qt-creator
Clang: Fix highlighting of template function in using declaration
This completes
commit a3a62e78f7
Clang: Fix highlighting of function in using declaration
Change-Id: I3c163096374d7a1f45a590bb8ebfe5f5a1f8d417
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -165,7 +165,8 @@ void HighlightingMark::overloadedDeclRefKind(const Cursor &cursor)
|
||||
// Workaround https://bugs.llvm.org//show_bug.cgi?id=33256 - SomeType in
|
||||
// "using N::SomeType" is mistakenly considered as a CXCursor_OverloadedDeclRef.
|
||||
if (cursor.overloadedDeclarationsCount() >= 1
|
||||
&& cursor.overloadedDeclaration(0).kind() != CXCursor_FunctionDecl) {
|
||||
&& cursor.overloadedDeclaration(0).kind() != CXCursor_FunctionDecl
|
||||
&& cursor.overloadedDeclaration(0).kind() != CXCursor_FunctionTemplate) {
|
||||
m_types.mainHighlightingType = HighlightingType::Type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -579,3 +579,6 @@ void f32()
|
||||
|
||||
NonConstPointerArgument(x.getter());
|
||||
}
|
||||
|
||||
namespace N { template <typename T> void SizeIs(); }
|
||||
using N::SizeIs;
|
||||
|
||||
@@ -1177,6 +1177,13 @@ TEST_F(HighlightingMarks, DISABLED_VariableInOperatorFunctionCall)
|
||||
ASSERT_THAT(infos[2], HasOnlyType(HighlightingType::LocalVariable));
|
||||
}
|
||||
|
||||
TEST_F(HighlightingMarks, UsingTemplateFunction)
|
||||
{
|
||||
const auto infos = translationUnit.highlightingMarksInRange(sourceRange(584, 17));
|
||||
|
||||
ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::Function));
|
||||
}
|
||||
|
||||
Data *HighlightingMarks::d;
|
||||
|
||||
void HighlightingMarks::SetUpTestCase()
|
||||
|
||||
Reference in New Issue
Block a user