[PATCH] D42291: [libcxx] Correctly handle invalid regex character class names

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 12:37:07 PST 2018

mclow.lists accepted this revision.
mclow.lists added a comment.
This revision is now accepted and ready to land.

This looks fine to me. Thanks!

Comment at: test/std/re/re.regex/re.regex.construct/bad_ctype.pass.cpp:28
+    } catch (const std::regex_error &ex) {
+        result = (ex.code() == std::regex_constants::error_ctype);
+    }
I'm a big fan of the "return NOW" style of programming.
But this matches the other tests, so I'm ok with it.
(If I care enough, I'll change them all later)

    try { std::regex re(pat); }
    catch catch (const std::regex_error &ex) { return ex.code() == std::regex_constants::error_ctype; }
    return false;


More information about the cfe-commits mailing list