forked from OSchip/llvm-project
[clangd] Add std::size_t to StdSymbol mapping
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. Differential Revision: https://reviews.llvm.org/D95423
This commit is contained in:
parent
b208e5bcd0
commit
9190f17a7c
|
@ -92,6 +92,8 @@ void CanonicalIncludes::addSystemHeadersMapping(const LangOptions &Language) {
|
|||
#include "StdSymbolMap.inc"
|
||||
// There are two std::move()s, this is by far the most common.
|
||||
SYMBOL(move, std::, <utility>)
|
||||
// There are multiple headers for size_t, pick one.
|
||||
SYMBOL(size_t, std::, <cstddef>)
|
||||
#undef SYMBOL
|
||||
});
|
||||
StdSymbolMapping = Symbols;
|
||||
|
@ -99,6 +101,8 @@ void CanonicalIncludes::addSystemHeadersMapping(const LangOptions &Language) {
|
|||
static const auto *CSymbols = new llvm::StringMap<llvm::StringRef>({
|
||||
#define SYMBOL(Name, NameSpace, Header) {#Name, #Header},
|
||||
#include "CSymbolMap.inc"
|
||||
// There are multiple headers for size_t, pick one.
|
||||
SYMBOL(size_t, None, <stddef.h>)
|
||||
#undef SYMBOL
|
||||
});
|
||||
StdSymbolMapping = CSymbols;
|
||||
|
|
Loading…
Reference in New Issue