mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
Cleanup _LIBCPP_HAS_NO_<c++11-features> macro usage in regex
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2539,14 +2539,14 @@ public:
|
|||||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||||
__end_(0)
|
__end_(0)
|
||||||
{__parse(__first, __last);}
|
{__parse(__first, __last);}
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex(initializer_list<value_type> __il,
|
basic_regex(initializer_list<value_type> __il,
|
||||||
flag_type __f = regex_constants::ECMAScript)
|
flag_type __f = regex_constants::ECMAScript)
|
||||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||||
__end_(0)
|
__end_(0)
|
||||||
{__parse(__il.begin(), __il.end());}
|
{__parse(__il.begin(), __il.end());}
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
// ~basic_regex() = default;
|
// ~basic_regex() = default;
|
||||||
|
|
||||||
@@ -2555,11 +2555,11 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex& operator=(const value_type* __p)
|
basic_regex& operator=(const value_type* __p)
|
||||||
{return assign(__p);}
|
{return assign(__p);}
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex& operator=(initializer_list<value_type> __il)
|
basic_regex& operator=(initializer_list<value_type> __il)
|
||||||
{return assign(__il);}
|
{return assign(__il);}
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
template <class _ST, class _SA>
|
template <class _ST, class _SA>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
|
basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
|
||||||
@@ -2569,7 +2569,7 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex& assign(const basic_regex& __that)
|
basic_regex& assign(const basic_regex& __that)
|
||||||
{return *this = __that;}
|
{return *this = __that;}
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex& assign(basic_regex&& __that) _NOEXCEPT
|
basic_regex& assign(basic_regex&& __that) _NOEXCEPT
|
||||||
{return *this = _VSTD::move(__that);}
|
{return *this = _VSTD::move(__that);}
|
||||||
@@ -2626,14 +2626,14 @@ public:
|
|||||||
return assign(basic_regex(__first, __last, __f));
|
return assign(basic_regex(__first, __last, __f));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex& assign(initializer_list<value_type> __il,
|
basic_regex& assign(initializer_list<value_type> __il,
|
||||||
flag_type __f = regex_constants::ECMAScript)
|
flag_type __f = regex_constants::ECMAScript)
|
||||||
{return assign(__il.begin(), __il.end(), __f);}
|
{return assign(__il.begin(), __il.end(), __f);}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
// const operations:
|
// const operations:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@@ -6213,7 +6213,7 @@ public:
|
|||||||
regex_constants::match_default) = delete;
|
regex_constants::match_default) = delete;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
|
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
|
||||||
const regex_type& __re,
|
const regex_type& __re,
|
||||||
initializer_list<int> __submatches,
|
initializer_list<int> __submatches,
|
||||||
@@ -6227,7 +6227,7 @@ public:
|
|||||||
regex_constants::match_flag_type __m =
|
regex_constants::match_flag_type __m =
|
||||||
regex_constants::match_default) = delete;
|
regex_constants::match_default) = delete;
|
||||||
#endif
|
#endif
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
template <size_t _Np>
|
template <size_t _Np>
|
||||||
regex_token_iterator(_BidirectionalIterator __a,
|
regex_token_iterator(_BidirectionalIterator __a,
|
||||||
_BidirectionalIterator __b,
|
_BidirectionalIterator __b,
|
||||||
@@ -6327,7 +6327,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
|||||||
__init(__a, __b);
|
__init(__a, __b);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
template <class _BidirectionalIterator, class _CharT, class _Traits>
|
template <class _BidirectionalIterator, class _CharT, class _Traits>
|
||||||
regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
||||||
@@ -6342,7 +6342,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
|
|||||||
__init(__a, __b);
|
__init(__a, __b);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#endif // _LIBCPP_CXX03_LANG
|
||||||
|
|
||||||
template <class _BidirectionalIterator, class _CharT, class _Traits>
|
template <class _BidirectionalIterator, class _CharT, class _Traits>
|
||||||
template <size_t _Np>
|
template <size_t _Np>
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <regex>
|
// <regex>
|
||||||
|
|
||||||
// class regex_token_iterator<BidirectionalIterator, charT, traits>
|
// class regex_token_iterator<BidirectionalIterator, charT, traits>
|
||||||
@@ -23,7 +25,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
{
|
{
|
||||||
std::regex phone_numbers("\\d{3}-(\\d{4})");
|
std::regex phone_numbers("\\d{3}-(\\d{4})");
|
||||||
const char phone_book[] = "start 555-1234, 555-2345, 555-3456 end";
|
const char phone_book[] = "start 555-1234, 555-2345, 555-3456 end";
|
||||||
@@ -61,5 +62,4 @@ int main()
|
|||||||
++i;
|
++i;
|
||||||
assert(i == std::cregex_token_iterator());
|
assert(i == std::cregex_token_iterator());
|
||||||
}
|
}
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <regex>
|
// <regex>
|
||||||
|
|
||||||
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
|
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
|
||||||
@@ -21,7 +23,6 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
std::regex r2;
|
std::regex r2;
|
||||||
r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'});
|
r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'});
|
||||||
assert(r2.flags() == std::regex::ECMAScript);
|
assert(r2.flags() == std::regex::ECMAScript);
|
||||||
@@ -30,5 +31,4 @@ int main()
|
|||||||
r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended);
|
r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended);
|
||||||
assert(r2.flags() == std::regex::extended);
|
assert(r2.flags() == std::regex::extended);
|
||||||
assert(r2.mark_count() == 2);
|
assert(r2.mark_count() == 2);
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <regex>
|
// <regex>
|
||||||
|
|
||||||
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
|
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
|
||||||
@@ -19,10 +21,8 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
std::regex r2;
|
std::regex r2;
|
||||||
r2 = {'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'};
|
r2 = {'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'};
|
||||||
assert(r2.flags() == std::regex::ECMAScript);
|
assert(r2.flags() == std::regex::ECMAScript);
|
||||||
assert(r2.mark_count() == 2);
|
assert(r2.mark_count() == 2);
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
// <regex>
|
// <regex>
|
||||||
|
|
||||||
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
|
// template <class charT, class traits = regex_traits<charT>> class basic_regex;
|
||||||
@@ -18,7 +20,6 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
|
|
||||||
void
|
void
|
||||||
test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f, unsigned mc)
|
test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f, unsigned mc)
|
||||||
@@ -28,11 +29,9 @@ test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f,
|
|||||||
assert(r.mark_count() == mc);
|
assert(r.mark_count() == mc);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
std::string s1("\\(a\\)");
|
std::string s1("\\(a\\)");
|
||||||
std::string s2("\\(a[bc]\\)");
|
std::string s2("\\(a[bc]\\)");
|
||||||
std::string s3("\\(a\\([bc]\\)\\)");
|
std::string s3("\\(a\\([bc]\\)\\)");
|
||||||
@@ -67,5 +66,4 @@ int main()
|
|||||||
test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::egrep, 0);
|
test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::egrep, 0);
|
||||||
test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::egrep, 0);
|
test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::egrep, 0);
|
||||||
test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::egrep, 2);
|
test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::egrep, 2);
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user