This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7138e75d1bb5: [clangd] Avoid recursion on UnresolvedUsingValueDecl during semantic… (authored by nridge).
Changed prior to commit: https://reviews.llvm.org/D134827?vs=506359&id=506360#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134827/new/ https://reviews.llvm.org/D134827 Files: clang-tools-extra/clangd/SemanticHighlighting.cpp clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp Index: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp +++ clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp @@ -1045,7 +1045,15 @@ auto $LocalVariable_def[[s]] = $Operator[[new]] $Class[[Foo]]$Bracket[[<]]$TemplateParameter[[T]]$Bracket[[>]](); $Operator[[delete]] $LocalVariable[[s]]; } - )cpp"}; + )cpp", + // Recursive UsingValueDecl + R"cpp( + template <int> class $Class_def[[X]] { + template <int> class $Class_def[[Y]] { + using $Class[[Y]]<0>::$Unknown_dependentName[[xxx]]; + }; + }; + )cpp"}; for (const auto &TestCase : TestCases) // Mask off scope modifiers to keep the tests manageable. // They're tested separately. Index: clang-tools-extra/clangd/SemanticHighlighting.cpp =================================================================== --- clang-tools-extra/clangd/SemanticHighlighting.cpp +++ clang-tools-extra/clangd/SemanticHighlighting.cpp @@ -156,7 +156,7 @@ return HighlightingKind::Concept; if (const auto *UUVD = dyn_cast<UnresolvedUsingValueDecl>(D)) { auto Targets = Resolver->resolveUsingValueDecl(UUVD); - if (!Targets.empty()) { + if (!Targets.empty() && Targets[0] != UUVD) { return kindForDecl(Targets[0], Resolver); } return HighlightingKind::Unknown;
Index: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp +++ clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp @@ -1045,7 +1045,15 @@ auto $LocalVariable_def[[s]] = $Operator[[new]] $Class[[Foo]]$Bracket[[<]]$TemplateParameter[[T]]$Bracket[[>]](); $Operator[[delete]] $LocalVariable[[s]]; } - )cpp"}; + )cpp", + // Recursive UsingValueDecl + R"cpp( + template <int> class $Class_def[[X]] { + template <int> class $Class_def[[Y]] { + using $Class[[Y]]<0>::$Unknown_dependentName[[xxx]]; + }; + }; + )cpp"}; for (const auto &TestCase : TestCases) // Mask off scope modifiers to keep the tests manageable. // They're tested separately. Index: clang-tools-extra/clangd/SemanticHighlighting.cpp =================================================================== --- clang-tools-extra/clangd/SemanticHighlighting.cpp +++ clang-tools-extra/clangd/SemanticHighlighting.cpp @@ -156,7 +156,7 @@ return HighlightingKind::Concept; if (const auto *UUVD = dyn_cast<UnresolvedUsingValueDecl>(D)) { auto Targets = Resolver->resolveUsingValueDecl(UUVD); - if (!Targets.empty()) { + if (!Targets.empty() && Targets[0] != UUVD) { return kindForDecl(Targets[0], Resolver); } return HighlightingKind::Unknown;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits