Howard Hinnant | 24e9848 | 2010-06-24 21:28:00 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 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> |
| 30 | |
| 31 | template <class CharT> |
| 32 | void |
| 33 | test() |
| 34 | { |
| 35 | typedef std::basic_regex<CharT> BR; |
| 36 | static_assert((BR::icase == std::regex_constants::icase), ""); |
| 37 | static_assert((BR::nosubs == std::regex_constants::nosubs), ""); |
| 38 | static_assert((BR::optimize == std::regex_constants::optimize), ""); |
| 39 | static_assert((BR::collate == std::regex_constants::collate), ""); |
| 40 | static_assert((BR::ECMAScript == std::regex_constants::ECMAScript), ""); |
| 41 | static_assert((BR::basic == std::regex_constants::basic), ""); |
| 42 | static_assert((BR::extended == std::regex_constants::extended), ""); |
| 43 | static_assert((BR::awk == std::regex_constants::awk), ""); |
| 44 | static_assert((BR::grep == std::regex_constants::grep), ""); |
| 45 | static_assert((BR::egrep == std::regex_constants::egrep), ""); |
| 46 | } |
| 47 | |
| 48 | int main() |
| 49 | { |
| 50 | test<char>(); |
| 51 | test<wchar_t>(); |
| 52 | } |