Declare std::array members with attribute const [PR101831].
authorMartin Sebor <msebor@redhat.com>
Wed, 2 Feb 2022 00:19:11 +0000 (17:19 -0700)
committerMartin Sebor <msebor@redhat.com>
Wed, 2 Feb 2022 00:21:49 +0000 (17:21 -0700)
commit756eabacfcd767e39eea63257a026f61a4c4e661
treee7a3219e85fa7514068b6531e3c61822831ca589
parent07a6c52c4cd145d20488c4823669a2d984ba2051
Declare std::array members with attribute const [PR101831].

Resolves:
PR libstdc++/101831 - Spurious maybe-uninitialized warning on std::array::size

libstdc++-v3/ChangeLog:

PR libstdc++/101831
* include/std/array (begin): Declare const member function attribute
const.
(end, rbegin, rend, size, max_size, empty, data): Same.
* testsuite/23_containers/array/capacity/empty.cc: Add test cases.
* testsuite/23_containers/array/capacity/max_size.cc: Same.
* testsuite/23_containers/array/capacity/size.cc: Same.
* testsuite/23_containers/array/iterators/begin_end.cc: New test.
libstdc++-v3/include/std/array
libstdc++-v3/testsuite/23_containers/array/capacity/empty.cc
libstdc++-v3/testsuite/23_containers/array/capacity/max_size.cc
libstdc++-v3/testsuite/23_containers/array/capacity/size.cc
libstdc++-v3/testsuite/23_containers/array/iterators/begin_end.cc [new file with mode: 0644]