[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 17 12:18:28 PDT 2025


mizvekov wrote:

Regarding the double const , I think this is not a type printer bug per se.

By indiscriminately adding a qualifier to a type, we can produce a type which cannot be written, such as this const qualified array case. As such, we can never do a good job printing these anyway.

There are two issues:
* A single step desugaring with qualifier preservation could cause this. This could be produced as part of the type 'aka' in diagnostics. We probably should add a special case for arrays when single step desugaring.
* When adding const for `constexpr` declarations, we could probably add some new kind of type sugar node which represents how this qualifier was added.

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


More information about the cfe-commits mailing list