Add constexpr to <iterator> and <array> for C++17
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Aug 2016 10:13:12 +0000 (11:13 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 23 Aug 2016 10:13:12 +0000 (11:13 +0100)
commit06db992005654ed7993b9f7696e2c34751f82db2
tree83e76da6cbb230216e97ba2baa9fed4240101792
parent1135a1330cf66964e516fcd3f64beeaa7a4da848
Add constexpr to <iterator> and <array> for C++17

* include/bits/c++config (_GLIBCXX17_CONSTEXPR): Define.
* include/bits/range_access.h (begin, end, rbegin, rend, crbegin)
(crend): Add _GLIBCXX17_CONSTEXPR as per P0031R0.
* include/bits/stl_iterator.h (reverse_iterator, move_iterator)
(__make_reverse_iterator, make_reverse_iterator, make_move_iterator):
Likewise.
* include/bits/stl_iterator_base_funcs.h (__distance, __advance): Add
_GLIBCXX14_CONSTEXPR.
(distance, advance, next, prev): Add _GLIBCXX17_CONSTEXPR.
* include/std/array (array::begin, array::end, array::rbegin)
(array::rend, array::cbegin, array:cend, array::crbegin)
(array::crend, array::operator[], array::at, array::front)
(array::back, array::data): Likewise.
* testsuite/24_iterators/headers/iterator/range_access.cc: Replace
with separate tests for C++11, C++14, and C++17.
* testsuite/24_iterators/headers/iterator/range_access_c++11.cc: New.
* testsuite/24_iterators/headers/iterator/range_access_c++14.cc: New.
* testsuite/24_iterators/headers/iterator/range_access_c++17.cc: New.

From-SVN: r239690
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/c++config
libstdc++-v3/include/bits/range_access.h
libstdc++-v3/include/bits/stl_iterator.h
libstdc++-v3/include/bits/stl_iterator_base_funcs.h
libstdc++-v3/include/std/array
libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access.cc [deleted file]
libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++11.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++14.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++17.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc