Created attachment 200092 [details] Testcase I got the attached program. It has a global locale set (de_DE.UTF-8). Under Windows and Linux the regexes match. Under FreeBSD and clang the regex doesnt match. It seems related to the set locale. If i switch to boost::regex, my application works.
Expected output: "All ok" Got Output: "Bug triggered"
What makes you believe this is a locale or even libc++ problem? I don't see how any of the regular expressions are even locale dependent. I also cannot reproduce the problem without boost, neither on CURRENT nor 11. (I.e., using 'std::locale::global(std::locale("de_DE.UTF-8"));' to override the user's locale instead of the boost goop.) I don't have boost installed, so I can't explore that avenue, but I am having trouble even understanding how this program would fail.
I think it might be a bug in libc++ because on Windows(MSVC 2013 & MSVC 2017) and on Linux (gcc 8.2 + libstdc++) this regex (from std) matches with the global locale from boost. Also the regex from boost matches (replace std::regex by boost::regex). Do you think the other implementations are wrong? This bug triggers only (also on my box and only on freebsd with clang and libc++) when i use boost::locale. As you said, with std::locale() it matches. When i comment the locale out, and use the std locale, the regex matches.
I also don't understand why this regex is locale dependent and why it fails with the locale set from boost::locale.
Seems like it might be a Boost bug to me.
Created attachment 200200 [details] Simplified testcase Reduced testcase
For reference: Boost::locale issue https://github.com/boostorg/locale/issues/35 (I am waiting for a new account on llvm bug tracker).
Bug on LLVM Bugtracker: https://bugs.llvm.org/show_bug.cgi?id=40052