]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Make std::vector<bool>::reference constructor private [PR115098]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 21 Aug 2024 20:19:46 +0000 (21:19 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 23 Aug 2024 12:18:19 +0000 (13:18 +0100)
commitb25b101bc380004b82e25d2b1ef306856c75d864
tree67bd8259b5a03d109f17a6557fe5f687b323b38d
parentf9f599a44e3156a5f5679adc048ec6ff2f44cc0e
libstdc++: Make std::vector<bool>::reference constructor private [PR115098]

The standard says this constructor should be private.  LWG 4141 proposes
to remove it entirely. We still need it, but it doesn't need to be
public.

For std::bitset the default constructor is already private (and never
even defined) but there's a non-standard constructor that's public, but
doesn't need to be.

libstdc++-v3/ChangeLog:

PR libstdc++/115098
* include/bits/stl_bvector.h (_Bit_reference): Make default
constructor private. Declare vector and bit iterators as
friends.
* include/std/bitset (bitset::reference): Make constructor and
data members private.
* testsuite/20_util/bitset/115098.cc: New test.
* testsuite/23_containers/vector/bool/115098.cc: New test.
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/std/bitset
libstdc++-v3/testsuite/20_util/bitset/115098.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/bool/115098.cc [new file with mode: 0644]