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 //===----------------------------------------------------------------------===//
13 // basic_string(initializer_list<charT> il, const Allocator& a = Allocator()); // constexpr since C++20
18 #include "test_macros.h"
19 #include "test_allocator.h"
20 #include "min_allocator.h"
23 template <template <class> class Alloc
>
24 TEST_CONSTEXPR_CXX20
void test_string() {
26 std::basic_string
<char, std::char_traits
<char>, Alloc
<char> > s
= {'a', 'b', 'c'};
29 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
31 std::basic_string
<wchar_t, std::char_traits
<wchar_t>, Alloc
<wchar_t> > s
= {L
'a', L
'b', L
'c'};
38 TEST_CONSTEXPR_CXX20
bool test() {
39 test_string
<std::allocator
>();
40 test_string
<min_allocator
>();
45 int main(int, char**) {
48 static_assert(test());