Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I think this requires changes in other places too, for example when querying index for the children we rather want to query using the symbolid of template pattern, not the instantiation.
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
674–675 | instead of doing the traversal twice, can we just sent both pattern and instantiation here, and then prefer the specializationdecl instead of just selecting decls[0] below ? |
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
690 | maybe just const Decl *D = Decls.front() for(const auto *C : Decls) { if(isa<ClassTempl...>(C)) { D = C; break; } } | |
775 | nit: no need for braces | |
clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp | ||
421 | what about making use of template pattern in case of invalid instantiations? as type hierarchy tries to provide information regarding bases and children, I think it is more important to show those instead of template instantiation arguments. | |
472 | can you also add a case for deriving from explicit (partial) specialization and type hierarchy on instantiation of a different pattern? template <typename T> class X {}; template <typename T> class X<T*> {}; struct Child : X<int*> {}; X<int> fo^o; |
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
690 | now you can use explicitReferenceTargets instead, with only DeclRelation::Underlying set in the mask. |
clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp | ||
---|---|---|
421 | Is there a way to query a ClassTemplateSpecializationDecl for whether instantiating its base specifier failed? Or, should we fall back on the template pattern any time bases() is empty? |
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
141 | this will result in changes in behavior for other functionality (it is unfortunate if no tests regressed), for example findReferences did work on template patterns rather than instantiations now it won't receive pattern results when triggered on instantiations. whether we want that or not is up for debate, but definitely not part of this patch. | |
clang-tools-extra/clangd/unittests/TypeHierarchyTests.cpp | ||
421 | you can check for CTSD->isInvalidDecl() and fallback to pattern in such cases. |
Unit tests: pass. 61304 tests passed, 0 failed and 736 were skipped.
clang-tidy: pass.
clang-format: pass.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
680 | instead of creating a new function, could you rather inline that ? it is the only call site and almost the same with getDeclAtPosition. |
Unit tests: pass. 61729 tests passed, 0 failed and 779 were skipped.
clang-tidy: fail. Please fix clang-tidy findings.
clang-format: pass.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 61774 tests passed, 0 failed and 780 were skipped.
clang-tidy: pass.
clang-format: pass.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
this will result in changes in behavior for other functionality (it is unfortunate if no tests regressed), for example findReferences did work on template patterns rather than instantiations now it won't receive pattern results when triggered on instantiations. whether we want that or not is up for debate, but definitely not part of this patch.