[Bug libstdc++/96803] std::tuple chooses wrong constructor for uses-allocator construction
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 22 09:41:08 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96803
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:
https://gcc.gnu.org/g:6e86f0926f8de014cb0b0218442812e9f3ea8e95
commit r8-10525-g6e86f0926f8de014cb0b0218442812e9f3ea8e95
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Sep 22 09:39:33 2020 +0100
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)
More information about the Gcc-bugs
mailing list