diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-04-28 23:26:21 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-04-28 23:39:38 +0100 |
commit | 162c40a4c127cc55d701bb8760e17708d0ca2fe0 (patch) | |
tree | 79244a5440aa1ad1b33afbf2433de764ed0fb673 /libstdc++-v3/ChangeLog | |
parent | 50714f45eeaf315a0b55d3db3de3bf8df8e94b04 (diff) |
libstdc++: Fix regression in std::_Construct (PR 94831)
By trying to reuse the existing std::_Construct function as a wrapper
for std::construct_at I introduced regressions, because changing
std::_Construct to return non-void made it ill-formed for array types.
The solution is to revert _Construct to its former state, and change
allocator_traits::construct to explicitly call construct_at instead.
This decouples all the existing callers of _Construct from the new
construct_at requirements.
PR libstdc++/94831
* include/bits/alloc_traits.h (_S_construct): Restore placement
new-expression for C++11/14/17 and call std::construct_at directly
for C++20.
* include/bits/stl_construct.h (_Construct): Revert to non-constexpr
function returning void.
* testsuite/20_util/specialized_algorithms/
uninitialized_value_construct/94831.cc: New test.
* testsuite/23_containers/vector/cons/94831.cc: New test.
Diffstat (limited to 'libstdc++-v3/ChangeLog')
-rw-r--r-- | libstdc++-v3/ChangeLog | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f2ddc5e4776..a5b6769ce88 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2020-04-28 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/94831 + * include/bits/alloc_traits.h (_S_construct): Restore placement + new-expression for C++11/14/17 and call std::construct_at directly + for C++20. + * include/bits/stl_construct.h (_Construct): Revert to non-constexpr + function returning void. + * testsuite/20_util/specialized_algorithms/ + uninitialized_value_construct/94831.cc: New test. + * testsuite/23_containers/vector/cons/94831.cc: New test. + 2020-04-28 Patrick Palka <ppalka@redhat.com> LWG 3433 subrange::advance(n) has UB when n < 0 |