[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 21 14:32:27 PDT 2025
rjmccall wrote:
It's fine to make these operators look up and use the `size_t` / `ptrdiff_t` typedefs if they're available and have the right type. We would need to apply an allowlist to the attributes on the typedef, too — it would be quite abusive, but someone could use an `aligned` attribute on their `size_t` typedef, and that would be wrong. But once we've successfully done the lookup and associated checks, we can cache the result.
We can't use a canonically different type.
https://github.com/llvm/llvm-project/pull/136542
More information about the cfe-commits
mailing list