This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix hover 'local scope' to include class template params
ClosedPublic

Authored by sammccall on Nov 15 2019, 10:50 AM.

Diff Detail

Event Timeline

sammccall created this revision.Nov 15 2019, 10:50 AM

Build result: fail - 60138 tests passed, 2 failed and 729 were skipped.

failed: LLVM.CodeGen/NVPTX/vectorize-misaligned.ll
failed: LLVM.Transforms/LoadStoreVectorizer/AMDGPU/merge-stores.ll

Log files: console-log.txt, CMakeCache.txt

LGTM, with a question. What about default template params? I believe we would also like to print them, could you add a test case for that?

LGTM, with a question. What about default template params? I believe we would also like to print them, could you add a test case for that?

They're not printed, as the type is "as written". Added a testcase and a FIXME.
(I don't think this case is terribly important - either behavior seems to have its advantages, the combination of default parameters and partial specialization is fairly rare, and not much confusion seems likely in practice)

kadircet accepted this revision.Nov 19 2019, 1:30 AM

thanks! but again it looks as if rebasing went wrong :/

This revision is now accepted and ready to land.Nov 19 2019, 1:30 AM
This revision was automatically updated to reflect the committed changes.

Sorry about the bad rebase, I landed the right version i think :-)

LGTM, with a question. What about default template params? I believe we would also like to print them, could you add a test case for that?

They're not printed, as the type is "as written". Added a testcase and a FIXME.
(I don't think this case is terribly important - either behavior seems to have its advantages, the combination of default parameters and partial specialization is fairly rare, and not much confusion seems likely in practice)

Forgot to mention, I didn't fix this because it's significantly more work: for Type you have access to the canonical args (with defaults, but with type-parameter-0-0 instead of T), and the as-written args (where defaults are omitted).
I think you have to trawl around special casing various Decls if you want this to work. I wanted to get the cheap improvement in because realistically I won't get to that refinement soon.