According to [re.synopt]: "The type syntax_option_type is an implementation-defined bitmask type" [bitmask.types] defines some requirements for such types, specifically: "Here, the names C0, C1, etc. represent bitmask elements for this particular bitmask type. All such elements have distinct, nonzero values" Contrarily to this requirement, in libc++ std::regex_constants::ECMAScript is 0.
As mentioned in http://lists.llvm.org/pipermail/cfe-dev/2016-October/051290.html, the use of "0" breaks use cases like the following: bool isEcmaScript(::std::regex_constants::syntax_option_type v) { return v & ::std::regex_constants::ECMAScript; }
We've got some ABI-breaking stuff coming for <regex> When that happens, we'll circle back to this.
Fixed in commit 357190. Note that this requires a new dylib. (and is an ABI break, so it's off by default) Also, I looked at 'format_default' and 'match_default', but they're defined as empty bitmasks, so they stayed == 0.