Details
- Reviewers
sammccall - Commits
- rGe37653da1399: [clangd] Type hints for C++14 return type deduction
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/InlayHints.cpp | ||
---|---|---|
79 | nit: bool TrailingReturnType = D->getReturnTypeSourceRange().isValid()? | |
clang-tools-extra/clangd/unittests/InlayHintTests.cpp | ||
505 | This reads as "auto[: int] f1(int x);", which doesn't look much like familiar syntax, C++ or otherwise. I guess we could try auto f1(int x)[-> int];? (From playing with these in vscode, I'm not sure I find the punctuation very useful) |
clang-tools-extra/clangd/InlayHints.cpp | ||
---|---|---|
79 | Sorry, I don't really understand this comment. If you're thinking about the test case where a trailing return type is present and we avoid producing a hint in that case (f3 in TypeHints.ReturnTypeDeduction), that happens because getContainedAutoType() returns null, so we don't get into this block at all. | |
clang-tools-extra/clangd/unittests/InlayHintTests.cpp | ||
505 | I like this suggestion, thanks! I agree it's nice if the hint is in a place where it would have been valid syntax. |
nit: bool TrailingReturnType = D->getReturnTypeSourceRange().isValid()?