On Thu, 2 Mar 2023, 06:35 Thiago Macieira via Std-Proposals, <std-proposals@lists.isocpp.org> wrote:
On Wednesday, 1 March 2023 17:04:39 PST Edward Catmur via Std-Proposals wrote:
>  I'm not entirely sure that size_t can't promote to
> int, although obviously it doesn't on any sensible platform.

It's possible. Integer promotion rules say that only types of rank lesser than
int can promote to int and only so long as all the values of that integer fit
int, otherwise they promote to unsigned. Therefore, you'd need to find a
platform where

  sizeof(size_t) < sizeof(int)

That is permitted, but I don't think exists or has ever existed.

It exists, I had to fix libstdc++ for it recently:

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=75e562d2c4303d3918be9d1563284b0c580c5e45

(I mistakenly said I32LP16 in that commit msg but should have said something like I32LL64P16, better obviously long can't be smaller than int, but size_t can be unsigned short).