https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107902
Bug ID: 107902 Summary: std::sort isn't usable on 16-bit targets Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/bits/stl_algo.h:1948:42: error: call of overloaded '__lg(__gnu_cxx::__normal_iterator<std::chrono::time_zone*, std::vector<std::chrono::time_zone> >::difference_type)' is ambiguous 1948 | std::__lg(__last - __first) * 2, | ~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/string:51, from /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/chrono:44: /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/bits/stl_algobase.h:1509:3: note: candidate: 'constexpr int std::__lg(int)' 1509 | __lg(int __n) | ^~~~ /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/bits/stl_algobase.h:1513:3: note: candidate: 'constexpr unsigned int std::__lg(unsigned int)' 1513 | __lg(unsigned __n) | ^~~~ /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/bits/stl_algobase.h:1517:3: note: candidate: 'constexpr long int std::__lg(long int)' 1517 | __lg(long __n) | ^~~~ /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/bits/stl_algobase.h:1521:3: note: candidate: 'constexpr long unsigned int std::__lg(long unsigned int)' 1521 | __lg(unsigned long __n) | ^~~~ /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/bits/stl_algobase.h:1525:3: note: candidate: 'constexpr long long int std::__lg(long long int)' 1525 | __lg(long long __n) | ^~~~ /home/jwakely/src/gcc/build-16bit/msp430-elf/large/libstdc++-v3/include/bits/stl_algobase.h:1529:3: note: candidate: 'constexpr long long unsigned int std::__lg(long long unsigned int)' 1529 | __lg(unsigned long long __n) | ^~~~ I think this is because ptrdiff_t is __int20 and there's no overload for that type.