1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-exceptions
10 // XFAIL: with_system_cxx_lib=macosx10.11
11 // XFAIL: with_system_cxx_lib=macosx10.10
12 // XFAIL: with_system_cxx_lib=macosx10.9
16 // size_type max_size() const;
22 #include "test_macros.h"
23 #include "min_allocator.h"
29 assert(s
.max_size() >= s
.size());
31 const size_t sz
= s2
.max_size() + 1;
32 try { s2
.resize(sz
, 'x'); }
33 catch ( const std::length_error
& ) { return ; }
40 typedef std::string S
;
43 test(S("12345678901234567890123456789012345678901234567890"));
45 #if TEST_STD_VER >= 11
47 typedef std::basic_string
<char, std::char_traits
<char>, min_allocator
<char>> S
;
50 test(S("12345678901234567890123456789012345678901234567890"));