[clang] [Clang] Add thousands-separator to "cannot allocate array; evaluated array bound [...] exceeds the limit" diagnostic (PR #211785)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 07:59:08 PDT 2026


AaronBallman wrote:

> That said, I'm not certain what a good heuristic is,

Actually, I would not be surprised if there's some Ux literature out there on this we could lean on.

Absent that...

For hex values, I think it might make sense to always split every quad. e.g., `0xF`, `0xF000`, `0xF000'F`, `0xF000'F000'F`, etc. For binary values, probably every quad as well, like `0b1000'1`. For decimal values, I think maybe it makes sense to do triples once we get to hundreds of thousands. e.g., `1000`, `10000`, `100'000`, `1'000'000` because that at least carves out values like `1024` which I think would be more distracting as `1'024`.

https://github.com/llvm/llvm-project/pull/211785


More information about the cfe-commits mailing list