]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix std::vector<bool>::emplace to forward parameter
authorJonathan Wakely <jwakely@redhat.com>
Sat, 26 Oct 2024 20:24:58 +0000 (21:24 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Sun, 27 Oct 2024 20:05:46 +0000 (20:05 +0000)
commitf1c844be5202f4be446f165d9a7625eb7ec4c5b4
tree0614d2af2dd8203db576c8bab64bc4ef5e87ff32
parent8e6cc1e7cdbb431a0950e491ed2830213f3ad81b
libstdc++: Fix std::vector<bool>::emplace to forward parameter

If the parameter is not lvalue-convertible to bool then the current code
will fail to compile. The parameter should be forwarded to restore the
original value category.

libstdc++-v3/ChangeLog:

* include/bits/stl_bvector.h (emplace_back, emplace): Forward
parameter pack to preserve value category.
* testsuite/23_containers/vector/bool/emplace_rvalue.cc: New
test.
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/testsuite/23_containers/vector/bool/emplace_rvalue.cc [new file with mode: 0644]