]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/testsuite/20_util/scoped_allocator/construct_pair_c++2a.cc
Tweak C++2a uses-allocator construction utilities
authorJonathan Wakely <jwakely@redhat.com>
Fri, 26 Apr 2019 13:15:54 +0000 (14:15 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 26 Apr 2019 13:15:54 +0000 (14:15 +0100)
commit3addb7b937c614101cd3bb7a7e91cd3fc84d30b5
tree1799a03d53278642703aea816f537ed458d7b13a
parentf8790a498e2edb064634b41853e74be84aaf86aa
Tweak C++2a uses-allocator construction utilities

The 20_util/scoped_allocator/69293_neg.cc test was failing in C++2a mode
because the expected static_assert text wasn't matched. The code is
still ill-formed in C++2a, but uses the new __uses_alloc_args function
and so fails a different static_assert. This patch adds the same string
to the new static_assert, so the test passes.

Now that G++ allows concepts to be declared without 'bool' we can use
the correct C++2a syntax for the _Std_pair concept used to constrain the
uses-allocator construction utilities.

Also add a new test to verify that pmr::polymorphic_allocator correctly
performs recursive uses-allocator construction for nested pairs in
C++2a.

* include/std/memory (__uses_alloc_args): Add string-literal to
static_assert, to match the one in __uses_alloc.
[__cpp_concepts] (_Std_pair): Use C++2a syntax for concept.
* testsuite/20_util/polymorphic_allocator/construct_c++2a.cc: Check
for recursive uses-allocator construction of nested pairs.
* testsuite/20_util/scoped_allocator/construct_pair_c++2a.cc:: Add
comment.

From-SVN: r270600
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/memory
libstdc++-v3/testsuite/20_util/polymorphic_allocator/construct_c++2a.cc
libstdc++-v3/testsuite/20_util/scoped_allocator/construct_pair_c++2a.cc