This is an archive of the discontinued LLVM Phabricator instance.

[clangd][Hover] Handle uninstantiated templates
ClosedPublic

Authored by kadircet on Jan 24 2020, 4:04 AM.

Diff Detail

Event Timeline

kadircet created this revision.Jan 24 2020, 4:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2020, 4:04 AM

Unit tests: unknown.

clang-tidy: unknown.

clang-format: unknown.

Build artifacts: diff.json, console-log.txt

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

sammccall accepted this revision.Jan 24 2020, 5:25 AM

Can you file a new bug or modify the upstream one to audit existing uses of getTemplateInstantiationPattern() (and maybe related functions)?

getSpecializedTemplate() is used with no null check in findTarget and xrefs, and I'm sure related cases are around too.

clang-tools-extra/clangd/Hover.cpp
210

I think "Template may not be instantiated e.g. if the type didn't need to be complete; fallback to primary template." might be enough of a comment here

clang-tools-extra/clangd/unittests/HoverTests.cpp
559

make these comments meaningful

562

Can you add a comment about what specifically this is testing?
(Type isn't instantiated, we fall back to primary template)

This revision is now accepted and ready to land.Jan 24 2020, 5:25 AM
kadircet updated this revision to Diff 240559.Jan 27 2020, 6:38 AM
kadircet marked 3 inline comments as done.
  • Address comments

Unit tests: fail. 62158 tests passed, 5 failed and 811 were skipped.

failed: libc++.std/language_support/cmp/cmp_partialord/partialord.pass.cpp
failed: libc++.std/language_support/cmp/cmp_strongeq/cmp.strongeq.pass.cpp
failed: libc++.std/language_support/cmp/cmp_strongord/strongord.pass.cpp
failed: libc++.std/language_support/cmp/cmp_weakeq/cmp.weakeq.pass.cpp
failed: libc++.std/language_support/cmp/cmp_weakord/weakord.pass.cpp

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

This revision was automatically updated to reflect the committed changes.