[Bug c++/98216] [C++20] std::array template parameter error with negative values

2020-12-14 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98216 Patrick Palka changed: What|Removed |Added CC||ppalka at gcc dot gnu.org --- Comment #5

[Bug c++/98216] [C++20] std::array template parameter error with negative values

2020-12-10 Thread emmanuel.le-trong--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98216 --- Comment #4 from Emmanuel Le Trong --- Looking at the symbols in your snippet: $ nm -C toto | grep wrapper 00402030 u wrapper::arr That looks like a weird NaN to me.

[Bug c++/98216] [C++20] std::array template parameter error with negative values

2020-12-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98216 --- Comment #3 from Jonathan Wakely --- Reduced: struct an_array { constexpr bool operator==(const an_array& a) const { return d == a.d; } double d; }; constexpr auto add_array (an_array a, an_array b) { a.d += b.d; return a; } templa

[Bug c++/98216] [C++20] std::array template parameter error with negative values

2020-12-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98216 --- Comment #2 from Jonathan Wakely --- Reduced: template struct array { constexpr T& operator[](int n) { return d[n]; } constexpr const T& operator[](int n) const { return d[n]; } constexpr bool operator==(const array& a) const { f

[Bug c++/98216] [C++20] std::array template parameter error with negative values

2020-12-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98216 --- Comment #1 from Richard Biener --- I guess the issue has to be with you using 'static constexpr auto arr' and that not being correctly templated on the expression. Well, confirmed your observation.

[Bug c++/98216] [C++20] std::array template parameter error with negative values

2020-12-09 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98216 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|