[llvm-bugs] [Bug 42199] New: Wrong implementation for regex_constants in clang

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 8 17:57:31 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42199

            Bug ID: 42199
           Summary: Wrong implementation for regex_constants in clang
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: youkaichao at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

The following code:
```
#include <regex>
#include <iostream>
using namespace std;

int main()
{
        regex re0("^cd");
        string str = "cd";
        cout << regex_search(str, re0, regex_constants::match_prev_avail) <<
endl;
        cout << regex_search(str, re0) << endl;
}
```

gives the output:
 ```
1
1
```

But as specified in the c++ standard, the output should be:
```
0
1
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190609/b06e1f7e/attachment.html>


More information about the llvm-bugs mailing list