On 03/12/20 18:14 +0100, Daniel Krügler via Libstdc++ wrote:
Am Do., 3. Dez. 2020 um 18:10 Uhr schrieb Jonathan Wakely via
Libstdc++ <libstd...@gcc.gnu.org>:
[..]
>>Ok to commit ?
>
>Yes, this is a nice simplification, thanks.
This broke the C++11 constexpr support in std::array. Fixed with this
patch. Tested x86_64-linux, committed to trunk.
Wouldn't a transformation into a comma expression, such as
return __glibcxx_requires_subscript(__n), _AT_Type::_S_ref(_M_elems, __n);
realize the same thing but would still keep the assertion-like thing?
No, because the assertion is defined as do { ... } while(false) so
can't be used in C++11 constexpr functions.
We could change that, or introduce new assertion macros just for this
case, but I don't care about C++11 enough to do it.