Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/InlayHints.cpp | ||
---|---|---|
140 | we should have this bail out after introducing the scope_exit below to make sure we skip the field. | |
clang-tools-extra/clangd/unittests/InlayHintTests.cpp | ||
1427 | a better test would be struct A{}; struct Foo {int a; int b;}; Foo f{A(), 1); and make sure we still get the hints for 1 as b. |
address review comment -- make sure we skip the corresponding field when its
init expr is null, and polish the testcase.
clang-tools-extra/clangd/InlayHints.cpp | ||
---|---|---|
140 | good catch! You're right. |
clang-tools-extra/clangd/InlayHints.cpp | ||
---|---|---|
143–144 | nit: can you also update the comment to mention broken initializer (and maybe even a fixme to handle these, as in theory this is likely spelled in the code, but wasn't retained in the AST even as a recoveryexpr, hence we still have a place to attach the hint) |
update the comment.
clang-tools-extra/clangd/InlayHints.cpp | ||
---|---|---|
143–144 | Done, updated the comment. I'd rather leave out the FIXME (it is unclear that we will address it). The InitListExpr is tricky, the AST nodes is preserved in the syntactic form for InitListExpr (go-to-definition actually works on the broken initializer A() ), but here we're using the *semantic*-form... |
we should have this bail out after introducing the scope_exit below to make sure we skip the field.