Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterating using regex_iterator never ends #33028

Closed
karen-arutyunov mannequin opened this issue Jul 3, 2017 · 4 comments
Closed

Iterating using regex_iterator never ends #33028

karen-arutyunov mannequin opened this issue Jul 3, 2017 · 4 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@karen-arutyunov
Copy link
Mannequin

karen-arutyunov mannequin commented Jul 3, 2017

Bugzilla Link 33681
Resolution FIXED
Resolved on Jul 05, 2017 09:37
Version 3.9
OS Linux
CC @mclow

Extended Description

While using regex_iterator template in our build2 toolchain project we have discovered that for some regular expressions the end iterator can never be reached.

The issue can be reproduced with the following code:

std::string s ("foo");
std::regex re (".*");

using it = std::regex_iteratorstd::string::const_iterator;

for (it i (s.begin (), s.end (), re), e; i != e; ++i) ; // Hangs.

@karen-arutyunov
Copy link
Mannequin Author

karen-arutyunov mannequin commented Jul 3, 2017

assigned to @mclow

@mclow
Copy link
Contributor

mclow commented Jul 4, 2017

If you change your regex to '.+' (match at least one character), it works fine.

@karen-arutyunov
Copy link
Mannequin Author

karen-arutyunov mannequin commented Jul 4, 2017

You right. Unfortunately, in our case regexes come from the end user, so we unable to amend them.

@mclow
Copy link
Contributor

mclow commented Jul 5, 2017

Fixed in revision 307171

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

1 participant