<div dir="ltr">Please file a bug or submit a patch.<div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 14, 2016 at 6:38 PM, Krzysztof Parzyszek via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The test is<br>
projects/libcxx/test/std/re/re<wbr>.alg/re.alg.match/basic.pass.<wbr>cpp<br>
<br>
This assertion fails on FreeBSD:<br>
<br>
std::locale::global(std::local<wbr>e(LOCALE_cs_CZ_ISO8859_2));<br>
{<br>
std::cmatch m;<br>
const char s[] = "m";<br>
assert(std::regex_match(s, m, std::regex("[a[=M=]z]",<br>
std::regex_constants::basic)))<wbr>;<br>
<br>
<br>
>From the looks of it, "m" should not match "[=M=]". M is not a special letter in Czech, as far as I know, and the match is case-sensitive.<br>
<br>
Libc seems to agree with this:<br>
<br>
--- t.c ---<br>
#include <locale.h><br>
#include <stdio.h><br>
#include <regex.h><br>
<br>
char errbuf[1024];<br>
<br>
int main() {<br>
int r;<br>
regex_t re;<br>
regmatch_t m;<br>
<br>
setlocale(LC_COLLATE, "cs_CZ.ISO8859_2");<br>
<br>
r = regcomp(&re, "[a[=M=]z]", REG_BASIC);<br>
printf("regcomp=%d\n", r);<br>
<br>
r = regexec(&re, "m", 0, &m, 0);<br>
printf("regexec=%d\n", r);<br>
<br>
if (r != 0) {<br>
regerror(r, &re, errbuf, 1023);<br>
printf("error: %s\n", errbuf);<br>
}<br>
}<br>
-----------<br>
<br>
clang t.c<br>
./a.out<br>
<br>
regcomp=0<br>
regexec=1<br>
error: regexec() failed to match<br>
<br>
<br>
If the string in t.c is "M", it matches.<br>
<br>
-Krzysztof<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>