This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add std::size_t to StdSymbol mapping
ClosedPublic

Authored by kadircet on Jan 25 2021, 10:41 PM.

Details

Summary

This is a common symbol that's missing from our mapping because
cppreference yields multiple headers.

Add it manually by picking cstddef to prevent insertion of some stdlib-internal
headers instead.

Fixes https://github.com/clangd/clangd/issues/666.

Diff Detail

Event Timeline

kadircet created this revision.Jan 25 2021, 10:41 PM
kadircet requested review of this revision.Jan 25 2021, 10:41 PM
sammccall accepted this revision.Jan 26 2021, 4:20 AM

This might annoy people occasionally, but so does the current behavior.
I guess inserting *nothing* might be better, we could have a list of symbols known to have no insertable header. But we don't have that today, and this is an improvement we can land before the 12 release.

stddef seems like the best choice among the headers that provide size_t.

This revision is now accepted and ready to land.Jan 26 2021, 4:20 AM
This revision was automatically updated to reflect the committed changes.