Commit c0364564 authored by Nikolai Kosjar's avatar Nikolai Kosjar

Clang: Fix highlighting of template function in using declaration

This completes

    commit a3a62e78
    Clang: Fix highlighting of function in using declaration

Change-Id: I3c163096374d7a1f45a590bb8ebfe5f5a1f8d417
Reviewed-by: Ivan Donchevskii's avatarIvan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke's avatarMarco Bubke <marco.bubke@qt.io>
parent 63551d77
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment