1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <list>
11 // UNSUPPORTED: c++98, c++03, c++11, c++14
12 // UNSUPPORTED: libcpp-no-deduction-guides
13
14
15 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
16 // list(InputIterator, InputIterator, Allocator = Allocator())
17 // -> list<typename iterator_traits<InputIterator>::value_type, Allocator>;
18 //
19
20
21 #include <list>
22 #include <iterator>
23 #include <cassert>
24 #include <cstddef>
25 #include <climits> // INT_MAX
26
27 struct A {};
28
main()29 int main()
30 {
31 // Test the explicit deduction guides
32
33 // Test the implicit deduction guides
34 {
35 // list (allocator &)
36 std::list lst((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'list'}}
37 // Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
38 // Also, we can't use {} instead of parens, because that constructs a
39 // deque<allocator<int>, allocator<allocator<int>>>
40 }
41
42 }
43