zygoloid wrote: Another possibility would be to add a new kind of type sugar for these cases that has the same canonical type but knows that it should print as `size_t` / `ptrdiff_t` etc. That'd allow you to produce an identical AST regardless of whether the typedefs are included, which seems like it'd be better for tooling than having the sugared type depend on which includes are present.
When formatting the type, you'd need to decide whether you want to always use `size_t` as the formatted name, or perform some additional check such as performing a name lookup into the global scope or into namespace `std` to see if the type is present and correct, but that's just a type printing policy decision, not something that affects correctness. https://github.com/llvm/llvm-project/pull/136542 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits