diff --git a/src/tools/clangbackend/ipcsource/highlightingmark.cpp b/src/tools/clangbackend/ipcsource/highlightingmark.cpp index bc918326a7c..510192b6e70 100644 --- a/src/tools/clangbackend/ipcsource/highlightingmark.cpp +++ b/src/tools/clangbackend/ipcsource/highlightingmark.cpp @@ -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; } } diff --git a/tests/unit/unittest/data/highlightingmarks.cpp b/tests/unit/unittest/data/highlightingmarks.cpp index 5b3374d582a..860dbddc708 100644 --- a/tests/unit/unittest/data/highlightingmarks.cpp +++ b/tests/unit/unittest/data/highlightingmarks.cpp @@ -579,3 +579,6 @@ void f32() NonConstPointerArgument(x.getter()); } + +namespace N { template void SizeIs(); } +using N::SizeIs; diff --git a/tests/unit/unittest/highlightingmarks-test.cpp b/tests/unit/unittest/highlightingmarks-test.cpp index 7c21d7c8108..cbedd9d8445 100644 --- a/tests/unit/unittest/highlightingmarks-test.cpp +++ b/tests/unit/unittest/highlightingmarks-test.cpp @@ -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()