diff options
author | Peng Liu <winner245@hotmail.com> | 2025-03-19 11:36:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-19 11:36:29 -0400 |
commit | e53bea51829ee9876a2010fec1a13d740533b89a (patch) | |
tree | a6dd8c71037b43632f7c7fb473d8178bff4b83bf /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | d7879e524fbbc4c2790dac62343444191f736f00 (diff) | |
download | llvm-e53bea51829ee9876a2010fec1a13d740533b89a.zip llvm-e53bea51829ee9876a2010fec1a13d740533b89a.tar.gz llvm-e53bea51829ee9876a2010fec1a13d740533b89a.tar.bz2 |
[libc++] Fix ambiguous call in {ranges, std}::count (#122529)
This PR fixes an ambiguous call encountered while using the
`std::ranges::count` and `std::count` algorithms with `vector<bool>`
with small `size_type`s.
The ambiguity arises from integral promotions during the internal
bitwise arithmetic of the `count` algorithms for small integral types.
This results in multiple viable candidates:
`__libcpp_popcount(unsigned)`,` __libcpp_popcount(unsigned long)`, and
`__libcpp_popcount(unsigned long long)`, leading to an ambiguous call
error. To resolve this ambiguity, we introduce a dispatcher function,
`__popcount`, which directs calls to the appropriate overloads of
`__libcpp_popcount`. This closes #122528.
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions