xref: /minix3/external/bsd/libc++/dist/libcxx/test/re/re.regex/re.regex.const/constants.pass.cpp (revision 4684ddb6aab0b36791c8099bc705d6140b3d05d0)
1*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
2*4684ddb6SLionel Sambuc //
3*4684ddb6SLionel Sambuc //                     The LLVM Compiler Infrastructure
4*4684ddb6SLionel Sambuc //
5*4684ddb6SLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
6*4684ddb6SLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
7*4684ddb6SLionel Sambuc //
8*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
9*4684ddb6SLionel Sambuc 
10*4684ddb6SLionel Sambuc // <regex>
11*4684ddb6SLionel Sambuc 
12*4684ddb6SLionel Sambuc // template <class charT, class traits = regex_traits<charT>>
13*4684ddb6SLionel Sambuc // class basic_regex
14*4684ddb6SLionel Sambuc // {
15*4684ddb6SLionel Sambuc // public:
16*4684ddb6SLionel Sambuc //     // constants:
17*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type icase = regex_constants::icase;
18*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type nosubs = regex_constants::nosubs;
19*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type optimize = regex_constants::optimize;
20*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type collate = regex_constants::collate;
21*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type ECMAScript = regex_constants::ECMAScript;
22*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type basic = regex_constants::basic;
23*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type extended = regex_constants::extended;
24*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type awk = regex_constants::awk;
25*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type grep = regex_constants::grep;
26*4684ddb6SLionel Sambuc //     static constexpr regex_constants::syntax_option_type egrep = regex_constants::egrep;
27*4684ddb6SLionel Sambuc 
28*4684ddb6SLionel Sambuc #include <regex>
29*4684ddb6SLionel Sambuc #include <type_traits>
30*4684ddb6SLionel Sambuc 
31*4684ddb6SLionel Sambuc template <class _Tp>
where(const _Tp &)32*4684ddb6SLionel Sambuc void where(const _Tp &) {}
33*4684ddb6SLionel Sambuc 
34*4684ddb6SLionel Sambuc template <class CharT>
35*4684ddb6SLionel Sambuc void
test()36*4684ddb6SLionel Sambuc test()
37*4684ddb6SLionel Sambuc {
38*4684ddb6SLionel Sambuc     typedef std::basic_regex<CharT> BR;
39*4684ddb6SLionel Sambuc     static_assert((BR::icase == std::regex_constants::icase), "");
40*4684ddb6SLionel Sambuc     static_assert((BR::nosubs == std::regex_constants::nosubs), "");
41*4684ddb6SLionel Sambuc     static_assert((BR::optimize == std::regex_constants::optimize), "");
42*4684ddb6SLionel Sambuc     static_assert((BR::collate == std::regex_constants::collate), "");
43*4684ddb6SLionel Sambuc     static_assert((BR::ECMAScript == std::regex_constants::ECMAScript), "");
44*4684ddb6SLionel Sambuc     static_assert((BR::basic == std::regex_constants::basic), "");
45*4684ddb6SLionel Sambuc     static_assert((BR::extended == std::regex_constants::extended), "");
46*4684ddb6SLionel Sambuc     static_assert((BR::awk == std::regex_constants::awk), "");
47*4684ddb6SLionel Sambuc     static_assert((BR::grep == std::regex_constants::grep), "");
48*4684ddb6SLionel Sambuc     static_assert((BR::egrep == std::regex_constants::egrep), "");
49*4684ddb6SLionel Sambuc     where(BR::icase);
50*4684ddb6SLionel Sambuc     where(BR::nosubs);
51*4684ddb6SLionel Sambuc     where(BR::optimize);
52*4684ddb6SLionel Sambuc     where(BR::collate);
53*4684ddb6SLionel Sambuc     where(BR::ECMAScript);
54*4684ddb6SLionel Sambuc     where(BR::basic);
55*4684ddb6SLionel Sambuc     where(BR::extended);
56*4684ddb6SLionel Sambuc     where(BR::awk);
57*4684ddb6SLionel Sambuc     where(BR::grep);
58*4684ddb6SLionel Sambuc     where(BR::egrep);
59*4684ddb6SLionel Sambuc }
60*4684ddb6SLionel Sambuc 
main()61*4684ddb6SLionel Sambuc int main()
62*4684ddb6SLionel Sambuc {
63*4684ddb6SLionel Sambuc     test<char>();
64*4684ddb6SLionel Sambuc     test<wchar_t>();
65*4684ddb6SLionel Sambuc }
66