This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add include-fixer fixit for field_incomplete_or_sizeless diagnostic.
ClosedPublic

Authored by hokein on Jan 26 2021, 4:33 AM.

Diff Detail

Event Timeline

hokein created this revision.Jan 26 2021, 4:33 AM
hokein requested review of this revision.Jan 26 2021, 4:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2021, 4:33 AM
kadircet added inline comments.Jan 26 2021, 8:51 AM
clang-tools-extra/clangd/IncludeFixer.cpp
81

what about the sizless case ? we'll attach a fixit, but it is not going to fix the issue :(

clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
787–804

nit: add a using decl instead

hokein updated this revision to Diff 319492.Jan 27 2021, 1:14 AM

address comments.

hokein marked an inline comment as done.Jan 27 2021, 1:15 AM
hokein added inline comments.
clang-tools-extra/clangd/IncludeFixer.cpp
81

The sizeless type is a clang extension, I think our indexer doesn't index this kind of symbols, so we will not attach a fixit for them.

And I think sizeless case is rare in practice, I would not too worry about it.

kadircet accepted this revision.Jan 27 2021, 6:10 AM

LGTM!

clang-tools-extra/clangd/IncludeFixer.cpp
81

ah ok, i thought this was something more common like a recorddecl without any members and with a specific attribute. thanks for the link!

This revision is now accepted and ready to land.Jan 27 2021, 6:10 AM