Created on 2021-09-27.00:00:00 last changed 37 months ago
[ 2021-10-14; Reflector poll ]
Set priority to 3 after reflector poll.
[re.synopt] says:
A valid value of type syntax_option_type shall have at most one of the grammar elements ECMAScript, basic, extended, awk, grep, egrep, set.
But then we never say what happens if an invalid value is used.
What does std::regex(".", std::regex::grep|std::regex::awk) do? Is it undefined? Does it throw? It seems reasonable for basic_regex constructors to throw if f is not a valid value, i.e. for each non-default constructor:Throws: regex_error if f is not a valid value, or if […] is not a valid regular expression according to the grammar specified by f.
However, there is no regex_constants::error_code value suitable for this error condition.
Also, the constructors say "Postconditions: flags() returns f." This prevents an implementation from storing f|ECMAScript in flags() if no grammar element is present in f. This seems like an unnecessary restriction, and forces implementations to do extra work to check if the ECMAScript grammar is in use. Arguably, it would even be better to require implementations to set ECMAScript in flags() if no grammar element was set in the flags passed to the constructor. This problem was introduced by LWG 2330.History | |||
---|---|---|---|
Date | User | Action | Args |
2021-10-14 11:35:36 | admin | set | messages: + msg12161 |
2021-09-27 00:00:00 | admin | create |