[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 23 12:57:02 PDT 2025
erichkeane wrote:
> If you make it a canonical node, you also automatically don't get an `aka` in diagnostics, which might be an advantage (or not).
>
> Ie you avoid the aka in `size_t (aka 'unsigned long')` you currently get.
I don't think you'd WANT to avoid that, I would want a type-alias because what we want is actually something that works exactly LIKE a type alias in every way, except doesn't require declaration. Optimally we'd just generate a `size_t` alias, but as Aaron mentioned, we cannot use that name.
YES, of course we could come up with a new type-like-thing that aliases a specific type (at which point, I'd say it isn't really a type, just a type alias with a fancy representation), but not have it be a type alias, but really all that does is save us a node in the AST. IF we were worried about THAT, we could have it lazily constructed, though that buys us little.
https://github.com/llvm/llvm-project/pull/136542
More information about the cfe-commits
mailing list