diff --git a/clang-tools-extra/clangd/FindTarget.cpp b/clang-tools-extra/clangd/FindTarget.cpp --- a/clang-tools-extra/clangd/FindTarget.cpp +++ b/clang-tools-extra/clangd/FindTarget.cpp @@ -491,6 +491,13 @@ llvm::SmallVector( E->decls().begin(), E->decls().end())}); } + + void VisitSizeOfPackExpr(const SizeOfPackExpr *E) { + Refs.push_back(ReferenceLoc{NestedNameSpecifierLoc(), + E->getPackLoc(), + /*IsDecl=*/false, + {E->getPack()}}); + } }; Visitor V; diff --git a/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp b/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp --- a/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp +++ b/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp @@ -625,6 +625,13 @@ $InactiveCode[[]] #else int $Variable[[Active2]]; #endif + )cpp", + // Argument to 'sizeof...' + R"cpp( + template + struct $Class[[TupleSize]] { + static const int $StaticField[[size]] = sizeof...($TemplateParameter[[Elements]]); + }; )cpp"}; for (const auto &TestCase : TestCases) { checkHighlightings(TestCase);