[Bug libstdc++/54388] std::array.at() const results in undefined behaviour

2012-08-28 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54388 --- Comment #5 from Jonathan Wakely 2012-08-28 13:55:36 UTC --- The paper does have implementation experience, and experience shows we got it wrong ;) We could do: return __n < _Nm ? _M_instance[__n] : (std::__throw out_of_range(__N(

[Bug libstdc++/54388] std::array.at() const results in undefined behaviour

2012-08-28 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54388 --- Comment #4 from Daniel Krügler 2012-08-28 13:53:18 UTC --- (In reply to comment #3) > (In reply to comment #2) > > The fix is to remove the constexpr from array::at, which isn't required by > > the > > standard anyway: > > It's not required

[Bug libstdc++/54388] std::array.at() const results in undefined behaviour

2012-08-28 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54388 --- Comment #3 from Daniel Krügler 2012-08-28 13:43:42 UTC --- (In reply to comment #2) > The fix is to remove the constexpr from array::at, which isn't required by the > standard anyway: It's not required, but I would like to encourage you to k

[Bug libstdc++/54388] std::array.at() const results in undefined behaviour

2012-08-28 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54388 --- Comment #2 from Jonathan Wakely 2012-08-28 08:21:21 UTC --- The fix is to remove the constexpr from array::at, which isn't required by the standard anyway: diff --git a/libstdc++-v3/include/std/array b/libstdc++-v3/include/std/array index 58

[Bug libstdc++/54388] std::array.at() const results in undefined behaviour

2012-08-28 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54388 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|