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 // <vector>
10 // UNSUPPORTED: c++98, c++03, c++11, c++14
11 // UNSUPPORTED: libcpp-no-deduction-guides
12
13
14 // template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
15 // vector(InputIterator, InputIterator, Allocator = Allocator())
16 // -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
17 //
18
19
20 #include <deque>
21 #include <iterator>
22 #include <cassert>
23 #include <cstddef>
24
25
main(int,char **)26 int main(int, char**)
27 {
28 // Test the explicit deduction guides
29
30 // Test the implicit deduction guides
31 {
32 // vector (allocator &)
33 std::vector vec((std::allocator<int>())); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'vector'}}
34 // Note: The extra parens are necessary, since otherwise clang decides it is a function declaration.
35 // Also, we can't use {} instead of parens, because that constructs a
36 // deque<allocator<int>, allocator<allocator<int>>>
37 }
38
39
40 return 0;
41 }
42