-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Boost.locale makes std::regex not match anything #249
Comments
Of note, this does not seem to happen with gcc and libstdc++. I have not yet tried mixing clang with libstc++ nor gcc with libc++. |
in #35 it is also reported to fail with libc++. Also
Seemingly |
I was able to reproduce this on Linux with Clang 14.0.0 and libc++ but not with Clang 15.0.7 The minimal reproducer seems to be matching Edit: There seems to be a bug in libc++:
The issue doesn't happen when using |
I commented in llvm/llvm-project#39399 as I suspect this is a bug in libc++ which doesn't expect the behavior of the collation facet of Boost.Locale. Let's see what they say about that. There certainly is a bug in libc++ as |
I had initially posted a comment in #35, but maybe it deserves its own issue instead.
I think it's essentially the same problem, except I'm on macOS 13,
I'm using boost 1.86.0, built against ICU 74.2
I had seen this behavior before, and have never found a real solution. I now stumbled upon it again on a project. I spent about two days trying to tune my regex, thinking I must have made a mistake. Eventually I began simplifying it and simplifying it, without it resolving.
Eventually, I decided to make a minimal example to test it; so I have following code:
Which outputs
$ clang++ -o regex_test regex_test.cpp -std=c++17 -I/opt/local/include/ -lboost_locale-mt -lboost_system-mt -L/opt/local/lib && ./regex_test ready: 1, size: 3 match[0]: pozo = mani match[1]: pozo match[2]: mani
If I uncomment the
std::locale::global
line (with or without thepattern.imbue
), this happens instead:clang++ -o regex_test regex_test.cpp -std=c++17 -I/opt/local/include/ -lboost_locale-mt -lboost_system-mt -L/opt/local/lib && ./regex_test ready: 1, size: 0
I tried changing facets gradually, OR'ing them one by one and it always worked until I added
std::locale::collate
. From that point, removing all the others and keeping juststd::locale::locate
, still makes the regex not work.That already doesn't work.
The text was updated successfully, but these errors were encountered: