gcc/libstdc++-v3/testsuite/20_util/tuple
Jonathan Wakely b7dbc6723a DR 2586 fix value category in uses-allocator checks
Because uses-allocator construction is invariably done with a const
lvalue the __uses_alloc helper should use a const lvalue for the
is_constructible checks. Otherwise, it can detect that the type can be
constructed from an rvalue, and then an error happens when a const
lvalue is passed to the constructor instead.

Prior to LWG DR 2586 scoped_allocator_adaptor incorrectly used an rvalue
type in the is_constructible check and then used a non-const lvalue for
the actual construction. The other components using uses-allocator
construction (tuple and polymorphic_allocator) have always done so with
a const lvalue allocator, although the use of __use_alloc in our
implementation meant they behaved the same as scoped_allocator_adaptor
and incorrectly used rvalues for the is_constructible checks.

In C++20 the P0591R4 changes mean that all uses-allocator construction
is defined in terms of the new uses_allocator_construction_args
functions, which always use a const lvalue allocator.

The changes in this patch ensure that the __use_alloc helper correctly
matches the requirements in the standard, consistently using a const
lvalue allocator for the is_constructible checks and the actual
constructor arguments.

	* doc/xml/manual/intro.xml: Document LWG 2586 status.
	* include/bits/uses_allocator.h (__uses_alloc): Use const lvalue
	allocator type in is_constructible checks.
	* testsuite/20_util/scoped_allocator/69293_neg.cc: Adjust dg-error.
	* testsuite/20_util/scoped_allocator/dr2586.cc: New test.
	* testsuite/20_util/tuple/cons/allocators.cc: Add test using
	problematic type from LWG 2586 discussion.
	* testsuite/20_util/uses_allocator/69293_neg.cc: Adjust dg-error.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.

From-SVN: r268882
2019-02-14 15:08:33 +00:00
..
apply Update copyright years. 2019-01-01 13:31:55 +01:00
comparison_operators Update copyright years. 2019-01-01 13:31:55 +01:00
cons DR 2586 fix value category in uses-allocator checks 2019-02-14 15:08:33 +00:00
creation_functions Update copyright years. 2019-01-01 13:31:55 +01:00
element_access Update copyright years. 2019-01-01 13:31:55 +01:00
make_from_tuple Update copyright years. 2019-01-01 13:31:55 +01:00
requirements Update copyright years. 2019-01-01 13:31:55 +01:00
48476.cc Update copyright years. 2019-01-01 13:31:55 +01:00
51365.cc Update copyright years. 2019-01-01 13:31:55 +01:00
53648.cc Update copyright years. 2019-01-01 13:31:55 +01:00
56785.cc Update copyright years. 2019-01-01 13:31:55 +01:00
60497.cc Update copyright years. 2019-01-01 13:31:55 +01:00
61947.cc Update copyright years. 2019-01-01 13:31:55 +01:00
67844.cc Update copyright years. 2019-01-01 13:31:55 +01:00
77395.cc Update copyright years. 2019-01-01 13:31:55 +01:00
77802.cc Update copyright years. 2019-01-01 13:31:55 +01:00
78939.cc Update copyright years. 2019-01-01 13:31:55 +01:00
cv_tuple_element.cc Update copyright years. 2019-01-01 13:31:55 +01:00
cv_tuple_size_neg.cc Update copyright years. 2019-01-01 13:31:55 +01:00
cv_tuple_size.cc Update copyright years. 2019-01-01 13:31:55 +01:00
dr2729.cc Update copyright years. 2019-01-01 13:31:55 +01:00
moveable2.cc Update copyright years. 2019-01-01 13:31:55 +01:00
moveable.cc Update copyright years. 2019-01-01 13:31:55 +01:00
noexcept_move_assign.cc Update copyright years. 2019-01-01 13:31:55 +01:00
noexcept_swap.cc Update copyright years. 2019-01-01 13:31:55 +01:00
swap_cxx17.cc Update copyright years. 2019-01-01 13:31:55 +01:00
swap.cc Update copyright years. 2019-01-01 13:31:55 +01:00
tuple_element_t.cc Update copyright years. 2019-01-01 13:31:55 +01:00
tuple_element.cc Update copyright years. 2019-01-01 13:31:55 +01:00
tuple_size_v.cc Update copyright years. 2019-01-01 13:31:55 +01:00
tuple_size.cc Update copyright years. 2019-01-01 13:31:55 +01:00