Fixed PR10574: http://llvm.org/bugs/show_bug.cgi?id=10574
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@137522 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
{
|
||||
std::regex phone_numbers("\\d{3}-(\\d{4})");
|
||||
const char phone_book[] = "start 555-1234, 555-2345, 555-3456 end";
|
||||
@@ -60,5 +60,5 @@ int main()
|
||||
++i;
|
||||
assert(i == std::cregex_token_iterator());
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
std::regex r2;
|
||||
r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'});
|
||||
assert(r2.flags() == std::regex::ECMAScript);
|
||||
@@ -29,5 +29,5 @@ int main()
|
||||
r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended);
|
||||
assert(r2.flags() == std::regex::extended);
|
||||
assert(r2.mark_count() == 2);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
std::regex r2;
|
||||
r2 = {'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'};
|
||||
assert(r2.flags() == std::regex::ECMAScript);
|
||||
assert(r2.mark_count() == 2);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <regex>
|
||||
#include <cassert>
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
void
|
||||
test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f, unsigned mc)
|
||||
@@ -27,11 +27,11 @@ test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f,
|
||||
assert(r.mark_count() == mc);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
std::string s1("\\(a\\)");
|
||||
std::string s2("\\(a[bc]\\)");
|
||||
std::string s3("\\(a\\([bc]\\)\\)");
|
||||
@@ -66,5 +66,5 @@ 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, 2);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user