https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101318

            Bug ID: 101318
           Summary: Comparison operator
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tobias.bruell at gmail dot com
  Target Milestone: ---

The comparison operators for std::array<int8_t, N> seem a bit broken in gcc 10.
Seems to work in gcc 11 and 12. The following program should probably print the
same value twice. I assume it's a problem with the standard library?

```
#include <iostream>
#include <array>

int main() {
  int8_t const a = 0;
  int8_t const b = -1;
  std::cout << (a > b) << '\n';

  std::array<int8_t, 1> A = {a};
  std::array<int8_t, 1> B = {b};
  std::cout << (A > B) << '\n';
}
```

Reply via email to