libstdc++: Disable std::array assertions for C++11 constexpr
authorJonathan Wakely <jwakely@redhat.com>
Thu, 3 Dec 2020 17:08:01 +0000 (17:08 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 3 Dec 2020 17:08:01 +0000 (17:08 +0000)
commit91cfacc4b5d317b12a3bdcd798273a581568f645
tree8a0ccc7af231d5bb384b1ae116d356e0afc85024
parenteb8c2b30b947dd8a2012ee658117bea05e46bc85
libstdc++: Disable std::array assertions for C++11 constexpr

The recent changes to add assertions to std::array broke the functions
that need to be constexpr in C++11, because of the restrictive rules for
constexpr functions in C++11.

This simply disables the assertions for C++11 mode, so the functions can
be constexpr again.

libstdc++-v3/ChangeLog:

* include/std/array (array::operator[](size_t) const, array::front() const)
(array::back() const) [__cplusplus == 201103]: Disable
assertions.
* testsuite/23_containers/array/element_access/constexpr_element_access.cc:
Check for correct values.
* testsuite/23_containers/array/tuple_interface/get_neg.cc:
Adjust dg-error line numbers.
* testsuite/23_containers/array/debug/constexpr_c++11.cc: New test.
libstdc++-v3/include/std/array
libstdc++-v3/testsuite/23_containers/array/debug/constexpr_c++11.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/array/element_access/constexpr_element_access.cc
libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_neg.cc