[PATCH] D37958: [libc++] Correctly propagate user-defined lookup_classname().
Arthur O'Dwyer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 17 10:34:35 PDT 2017
Quuxplusone added inline comments.
================
Comment at: libcxx/test/std/re/re.traits/lookup_classname_user_defined.pass.cpp:46
+ // matches all characters (they are classified as alnum)
+ std::wstring re1 = L"([[:alnum:]]+)";
+ std::regex_search(in, m, std::wregex(re1));
----------------
Could you add a test here for
std::wstring re3 = L"([[:ALNUM:]]+)";
std::regex_search(in, m, std::wregex(re3, std::regex_constants::icase));
std::wstring re4 = L"(\\W+)";
std::regex_search(in, m, std::wregex(re4, std::regex_constants::icase));
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.
https://reviews.llvm.org/D37958
More information about the cfe-commits
mailing list