• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // <regex>
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 //    vector(InputIterator, InputIterator, Allocator = Allocator())
17 //    -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
18 //
19 
20 
21 #include <regex>
22 #include <string>
23 #include <iterator>
24 #include <cassert>
25 #include <cstddef>
26 
27 
main()28 int main()
29 {
30 //  Test the explicit deduction guides
31     {
32 //	basic_regex(ForwardIterator, ForwardIterator)
33 //  <int> is not an iterator
34     std::basic_regex re(23, 34);   // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_regex'}}
35     }
36 
37     {
38 //	basic_regex(ForwardIterator, ForwardIterator, flag_type)
39 //  <double> is not an iterator
40     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'}}
41     }
42 
43 //  Test the implicit deduction guides
44 
45 }
46