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 // <regex>
10 // UNSUPPORTED: 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 <regex>
21 #include <string>
22 #include <iterator>
23 #include <cassert>
24 #include <cstddef>
25
26
main(int,char **)27 int main(int, char**)
28 {
29 // Test the explicit deduction guides
30 {
31 // basic_regex(ForwardIterator, ForwardIterator)
32 // <int> is not an iterator
33 std::basic_regex re(23, 34); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_regex'}}
34 }
35
36 {
37 // basic_regex(ForwardIterator, ForwardIterator, flag_type)
38 // <double> is not an iterator
39 std::basic_regex re(23.0, 34.0, std::regex_constants::basic); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_regex'}}
40 }
41
42 // Test the implicit deduction guides
43
44
45 return 0;
46 }
47