blob: 42bc526aed048ae7f5caa89c64e00e2dae162a0f [file] [log] [blame]
Howard Hinnant24e98482010-06-24 21:28:00 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant24e98482010-06-24 21:28:00 +00007//
8//===----------------------------------------------------------------------===//
9
10// <regex>
11
12// template <class charT, class traits = regex_traits<charT>>
13// class basic_regex
14// {
15// public:
16// // constants:
17// static constexpr regex_constants::syntax_option_type icase = regex_constants::icase;
18// static constexpr regex_constants::syntax_option_type nosubs = regex_constants::nosubs;
19// static constexpr regex_constants::syntax_option_type optimize = regex_constants::optimize;
20// static constexpr regex_constants::syntax_option_type collate = regex_constants::collate;
21// static constexpr regex_constants::syntax_option_type ECMAScript = regex_constants::ECMAScript;
22// static constexpr regex_constants::syntax_option_type basic = regex_constants::basic;
23// static constexpr regex_constants::syntax_option_type extended = regex_constants::extended;
24// static constexpr regex_constants::syntax_option_type awk = regex_constants::awk;
25// static constexpr regex_constants::syntax_option_type grep = regex_constants::grep;
26// static constexpr regex_constants::syntax_option_type egrep = regex_constants::egrep;
27
28#include <regex>
29#include <type_traits>
Marshall Clowfd5ceb22016-04-26 16:24:44 +000030#include "test_macros.h"
Howard Hinnant24e98482010-06-24 21:28:00 +000031
Stephan T. Lavavejaae63562017-08-11 20:53:53 +000032template <class T>
33void where(const T &) {}
Howard Hinnant16694b52012-12-12 21:14:28 +000034
Howard Hinnant24e98482010-06-24 21:28:00 +000035template <class CharT>
36void
37test()
38{
39 typedef std::basic_regex<CharT> BR;
40 static_assert((BR::icase == std::regex_constants::icase), "");
41 static_assert((BR::nosubs == std::regex_constants::nosubs), "");
42 static_assert((BR::optimize == std::regex_constants::optimize), "");
43 static_assert((BR::collate == std::regex_constants::collate), "");
44 static_assert((BR::ECMAScript == std::regex_constants::ECMAScript), "");
45 static_assert((BR::basic == std::regex_constants::basic), "");
46 static_assert((BR::extended == std::regex_constants::extended), "");
47 static_assert((BR::awk == std::regex_constants::awk), "");
48 static_assert((BR::grep == std::regex_constants::grep), "");
49 static_assert((BR::egrep == std::regex_constants::egrep), "");
Howard Hinnant16694b52012-12-12 21:14:28 +000050 where(BR::icase);
51 where(BR::nosubs);
52 where(BR::optimize);
53 where(BR::collate);
54 where(BR::ECMAScript);
55 where(BR::basic);
56 where(BR::extended);
57 where(BR::awk);
58 where(BR::grep);
59 where(BR::egrep);
Howard Hinnant24e98482010-06-24 21:28:00 +000060}
61
62int main()
63{
64 test<char>();
65 test<wchar_t>();
66}