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

--- Comment #4 from Jason Liam <jlame646 at gmail dot com> ---
Note that we get the correct output for 129. Demo:
https://godbolt.org/z/eG69Tse1s

```
#include <cstddef>
#include <iostream>

struct Counter { // Counts number of `operator,` calls
  std::size_t count = 0;

  Counter& operator,(int) {
    ++count;
    return *this;
  }

  void finish(const char* label, std::size_t expected) const {
    std::cout << label << ": count=" << count << " expected=" << expected <<
"\n";
  }
};

int main() {


  Counter c129;
  c129, // an array of 130 zeros
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0;
  c129.finish("129", 129);
  return 0;
}
```

results in the correct output in both gcc and clang:

```
129: count=129 expected=129
```

Reply via email to