]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Use correct argument type for __use_alloc [PR 96803]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 22 Sep 2020 08:39:33 +0000 (09:39 +0100)
committerJakub Jelinek <jakub@redhat.com>
Mon, 28 Sep 2020 09:13:50 +0000 (11:13 +0200)
commitd78c0aebb2c1a9661177b6b1f1901f523c612114
tree591c2ed716afc987f0529a4f2fa2e9c1bec017f5
parente8797f5994a57712e9f4b3198173ad1f1ae74366
libstdc++: Use correct argument type for __use_alloc [PR 96803]

The _Tuple_impl constructor for allocator-extended construction from a
different tuple type uses the _Tuple_impl's own _Head type in the
__use_alloc test. That is incorrect, because the argument tuple could
have a different type. Using the wrong type might select the
leading-allocator convention when it should use the trailing-allocator
convention, or vice versa.

This backport includes the value category fix from r11-3348.

libstdc++-v3/ChangeLog:

PR libstdc++/96803
* include/std/tuple
(_Tuple_impl(allocator_arg_t, Alloc, const _Tuple_impl<U...>&)):
Replace parameter pack with a type parameter and a pack and pass
the first type to __use_alloc.
* testsuite/20_util/tuple/cons/96803.cc: New test.

(cherry picked from commit 5494edae83ad33c769bd1ebc98f0c492453a6417)
libstdc++-v3/include/std/tuple
libstdc++-v3/testsuite/20_util/tuple/cons/96803.cc [new file with mode: 0644]
This page took 0.063783 seconds and 6 git commands to generate.