Issue 170040
Summary [clang] Clang trunk regression breaks SFINAE with zero-sized array template parameter
Labels clang
Assignees
Reporter forworldm
    ```C++
#include <cstdint>
#include <cstddef>

template<int N> struct Foo {
    operator uint16_t() const noexcept requires(N == 2) {
        return 0;
    }

 template<int I = 0, char (*)[(N == 8) || (I & 0)] = nullptr>
    operator uint64_t() const noexcept {
        return 0;
    }
};

int main() {
 Foo<2> foo;
    std::size_t bar = foo;
    return bar;
}
```

clang emits: `error: zero-length arrays are not permitted in C++`.
Earlier versions of Clang (up to 21) compiled the same code without issues.
see [godbolt](https://godbolt.org/z/P67TaT1WP)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to