summaryrefslogtreecommitdiff
path: root/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/re/re.regex/re.regex.construct/deduct.fail.cpp')
-rw-r--r--test/std/re/re.regex/re.regex.construct/deduct.fail.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp b/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp
new file mode 100644
index 0000000000000..d4dc9e54fc52c
--- /dev/null
+++ b/test/std/re/re.regex/re.regex.construct/deduct.fail.cpp
@@ -0,0 +1,45 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: libcpp-no-deduction-guides
+
+
+// template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
+// vector(InputIterator, InputIterator, Allocator = Allocator())
+// -> vector<typename iterator_traits<InputIterator>::value_type, Allocator>;
+//
+
+
+#include <regex>
+#include <string>
+#include <iterator>
+#include <cassert>
+#include <cstddef>
+
+
+int main()
+{
+// Test the explicit deduction guides
+ {
+// basic_regex(ForwardIterator, ForwardIterator)
+// <int> is not an iterator
+ std::basic_regex re(23, 34); // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'basic_regex'}}
+ }
+
+ {
+// basic_regex(ForwardIterator, ForwardIterator, flag_type)
+// <double> is not an iterator
+ 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'}}
+ }
+
+// Test the implicit deduction guides
+
+}