diff --git a/clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp b/clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp index 3a320260238b6..5432b1ef37ec2 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp @@ -51,7 +51,8 @@ Expected AnnotateHighlightings::apply(const Selection &Inputs) { *Inputs.AST, /*IncludeInactiveRegionTokens=*/true); } else { // Store the existing scopes. - const auto &BackupScopes = Inputs.AST->getASTContext().getTraversalScope(); + const std::vector BackupScopes = + Inputs.AST->getASTContext().getTraversalScope(); // Narrow the traversal scope to the selected node. Inputs.AST->getASTContext().setTraversalScope( {const_cast(CommonDecl)});