[libcxx-commits] [PATCH] D62453: Regex backreference [3/3] Validate backreferences in the constructor.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 17 11:08:26 PDT 2019


Mordante marked 3 inline comments as done.
Mordante added inline comments.


================
Comment at: libcxx/include/regex:3554
                         unsigned __val = __traits_.value(*__temp, 10);
                         if (__val >= 1 && __val <= 9)
+                            if (__val > mark_count())
----------------
zoecarver wrote:
> Doesn't this if statement need braces around it?
Yes. This is the same location as you spotted in D62451.


================
Comment at: libcxx/test/std/re/re.regex/re.regex.construct/bad_backref.pass.cpp:21
 
-static bool error_badbackref_thrown(const char *pat)
+static bool error_badbackref_thrown(const char *pat, std::regex::flag_type f = std::regex_constants::ECMAScript)
 {
----------------
zoecarver wrote:
> Not an issue at all, just a small nit: the default value of `f` is never used. 
Actually the default argument is used in one call. I'll adjust that call and remove the default.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62453/new/

https://reviews.llvm.org/D62453





More information about the libcxx-commits mailing list