xref: /llvm-project/libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/alloc.compile.fail.cpp (revision 7a6aaf9b23d6ac2fb8c11c00c73e55c0bc7aa2f0)
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <forward_list>
10 
11 // explicit forward_list(const allocator_type& a);
12 
13 #include <forward_list>
14 #include <cassert>
15 
16 #include "test_allocator.h"
17 #include "../../../NotConstructible.h"
18 
main(int,char **)19 int main(int, char**)
20 {
21     {
22         typedef test_allocator<NotConstructible> A;
23         typedef A::value_type T;
24         typedef std::forward_list<T, A> C;
25         C c = A(12);
26         assert(c.get_allocator() == A(12));
27         assert(c.empty());
28     }
29 
30   return 0;
31 }
32