[clang] [Clang] Fix handling of zero-length arrays in sfinae context. (PR #170144)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 3 17:35:06 PST 2025


zygoloid wrote:

It looks like the same bug might exist for other recoverable type errors (where we successfully form a `QualType` in substitution despite producing a diagnostic). For example, we reject-valid on this too:
```c++
template <char N> struct Foo {
    operator int() const requires(N == 2);
    template <int M = 1234, Foo<M>* = nullptr> operator long() const;
};

void test () {
    Foo<2> foo;
    long bar = foo;
}
```
Could this be a bug in the handling of substitution into the type of a non-type template parameter, not something specific to array types?

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


More information about the cfe-commits mailing list