41 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <regex>10// UNSUPPORTED: c++03, c++11, c++1411 12// template<class ForwardIterator>13// basic_regex(ForwardIterator, ForwardIterator,14// regex_constants::syntax_option_type = regex_constants::ECMAScript)15// -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;16 17#include <regex>18#include <string>19#include <iterator>20#include <cassert>21#include <cstddef>22 23 24int main(int, char**)25{26 // Test the explicit deduction guides27 {28 // basic_regex(ForwardIterator, ForwardIterator)29 // <int> is not an iterator30 std::basic_regex re(23, 34); // expected-error-re {{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}basic_regex'}}31 }32 33 {34 // basic_regex(ForwardIterator, ForwardIterator, flag_type)35 // <double> is not an iterator36 std::basic_regex re(23.0, 34.0, std::regex_constants::basic); // expected-error-re {{no viable constructor or deduction guide for deduction of template arguments of '{{(std::)?}}basic_regex'}}37 }38 39 return 0;40}41