llvm / llvm/llvm-project

[Clang] Array comparison isn't rejected in C++26 mode when the involved array type is dependent in a function template

Open
#190,756 5 comments 0 reactions 0 assignees View on GitHub
accepts-invalid c++26 clang:frontend diverges-from:gcc
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The following program is ill-formed in C++26 (per [P2865R6](https://wg21.link/p2865r6)), but Clang currently fails to reject it even with option `-pedantic-errors`. [Godbolt link](https://godbolt.org/z/4Yns1Y8Y9).

```C++
int main() {
int a[1]{}, b[1]{};
[](const auto &x, const auto& y) {
return x == y;
}(a, b);
}
```

It seems that Clang only rejects array comparison when the array types are non-dependent currently.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.