Commit Graph

22 Commits

Author SHA1 Message Date
Stephan T. Lavavej
9165f9d181 [libcxx] [test] Strip trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334676 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14 00:12:20 +00:00
Marshall Clow
7b98dba18e Implement deduction guides for basic_regex
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333050 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-23 01:57:02 +00:00
Mikhail Maltsev
e54a22f809 [libcxx] Correctly handle invalid regex character class names
Summary:
Currently when a regular expression contains an invalid character
class name std::regex constructors throw an std::regex_error with
std::regex_constants::error_brack code.

This patch changes the code to std::regex_constants::error_ctype and
adds a test.

Reviewers: EricWF, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D42291

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323322 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-24 12:45:18 +00:00
Marshall Clow
24c7353aa9 Fix an unsigned integer overflow in regex that lead to a bad memory access. Found by OSS-Fuzz
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316191 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-19 22:10:41 +00:00
Stephan T. Lavavej
302557b724 [libcxx] [test] Rename _Tp to T. NFCI.
This improves readability and (theoretically) improves portability,
as _Ugly names are reserved.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@310758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-11 20:53:53 +00:00
Eric Fiselier
d89c715f29 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
2017-04-18 23:42:15 +00:00
Eric Fiselier
b7fd0be370 Update all bug URL's to point to https://bugs.llvm.org/...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 08:37:03 +00:00
Marshall Clow
99447c8e03 Fix bug #31387 - not checking end iterator when parsing decimal escape. Thanks to Karen for the report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 17:21:03 +00:00
Asiri Rathnayake
e3a71a295e [libcxx] Recover no-exceptions XFAILs - I
First batch of changes to get some of these XFAILs working in the
no-exceptions libc++ variant.

Changed some XFAILs to UNSUPPORTED where the test is all about exception
handling. In other cases, used the test macros TEST_THROW and
TEST_HAS_NO_EXCEPTIONS to conditionally exclude those parts of the test
that concerns exception handling behaviour.

Reviewers: EricWF, mclow.lists

Differential revision: https://reviews.llvm.org/D24562

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 11:15:41 +00:00
Hubert Tong
7f6e8e2141 [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctor
Summary:
The synopsis in C++11 subclause 28.8 [re.regex] has:
```
basic_regex(const charT* p, size_t len,
            flag_type f = regex_constants::ECMAScript);
```

The default argument is added to libc++ by this change.

Reviewers: mclow.lists, rsmith, hubert.reinterpretcast

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D22702

Reapplies r277966.
Patch by Jason Liu!


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 22:26:04 +00:00
Hubert Tong
5f9ee490e7 Revert r277966. Forgot patch attribution.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 22:23:24 +00:00
Hubert Tong
9bae734ed9 [libcxx] Add "flag" default arg: basic_regex ptr_size_flag ctor
Summary:
The synopsis in C++11 subclause 28.8 [re.regex] has:
```
basic_regex(const charT* p, size_t len,
            flag_type f = regex_constants::ECMAScript);
```

The default argument is added to libc++ by this change.

Reviewers: mclow.lists, rsmith, hubert.reinterpretcast

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D22702


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-07 22:18:33 +00:00
Hubert Tong
b49c67fad2 [libcxx] basic_regex: add traits_type, string_type
Summary:
In the synopsis in C++11 subclause 28.8 [re.regex], `basic_regex` is
specified to have member typedefs `traits_type` and `string_type`. This
change adds them to libc++.

Reviewers: mclow.lists, rsmith, hubert.reinterpretcast

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D22698

Patch by Jason Liu!


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@277526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 21:34:48 +00:00
Eric Fiselier
e443672b05 Avoid octal escape sequence warning with MSVC. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 05:47:46 +00:00
Eric Fiselier
84acb1ec3f Remove trailing whitespace in test suite. Approved by Marshall Clow.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 21:35:39 +00:00
Marshall Clow
6dfff1c9b9 #include <test_macros.h> in all the regex tests, and remove all mentions of __cpluplus (use TEST_STD_VERS and/or XFAIL instead). No functional change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267567 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26 16:24:44 +00:00
Daniel Sanders
cd17b3b156 [libcxx] Add appropriate 'REQUIRE' directives to tests that require en_US.UTF-8.
Reviewers: mclow.lists, hans

Subscribers: bcraig, cfe-commits

Differential Revision: http://reviews.llvm.org/D16406

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-21 15:35:15 +00:00
Marshall Clow
685cdcaf9f Fix PR#26175. Thanks to Josh Petrie for the report and the patch. Reviewed as http://reviews.llvm.org/D16262
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 00:50:37 +00:00
Asiri Rathnayake
cc2e93cff0 Make it possible to build a no-exceptions variant of libcxx.
Fixes a small omission in libcxx that prevents libcxx being built when
-DLIBCXX_ENABLE_EXCEPTIONS=0 is specified.

This patch adds XFAILS to all those tests that are currently failing
on the new -fno-exceptions library variant. Follow-up patches will
update the tests (progressively) to cope with the new library variant.

Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@252598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 11:41:22 +00:00
Marshall Clow
568bd0222f Detect and throw on a class of bad regexes that we mistakenly accepted before. Thanks to Trevor Smigiel for the report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243030 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 18:27:51 +00:00
Marshall Clow
083e011d6c Make regex::assign not clobber the regex in case of failure. Fixes PR#22213
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-13 16:49:52 +00:00
Eric Fiselier
a90c6dd460 Move test into test/std subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224658 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-20 01:40:03 +00:00