Always lookup the class name, even when the traits type is regex_traits<>.
The lookup happens at regex compile time, so it shouldn't affect the performance.
I also added ja_JP.UTF-8 as a common locale.
This patch fixes PR18501.
Differential D37958
[libc++] Correctly propagate user-defined lookup_classname(). timshen on Sep 17 2017, 12:04 AM. Authored by
Details
Always lookup the class name, even when the traits type is regex_traits<>. I also added ja_JP.UTF-8 as a common locale. This patch fixes PR18501.
Diff Detail
Event Timeline
|
Could you add a test here for
documenting the expected outputs? It's unclear to me from cppreference
http://en.cppreference.com/w/cpp/regex/regex_traits/lookup_classname
whether lookup_classname("W") is supposed to produce a result or not (but you seem to assume it does).
My understanding is that the "icase" parameter to lookup_classname is talking about the icaseness of the regex matcher; classnames should always be matched with exact case, i.e. [[:alnum:]] is always a valid classname and [[:ALNUM:]] is always invalid, regardless of regex_constants::icase. But I'm not sure.