]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Define basic_regex::multiline for non-strict modes
authorJonathan Wakely <jwakely@redhat.com>
Fri, 1 Oct 2021 13:06:42 +0000 (14:06 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 1 Oct 2021 14:04:03 +0000 (15:04 +0100)
The regex_constants::multiline constant is defined for non-strict C++11
and C++14 modes, on the basis that the feature is a DR (even though it
was really a new feature addition to C++17 and probably shouldn't have
gone through the issues list).

This makes the basic_regex::multiline constant defined consistently with
the regex_constants::multiline one.

For strict C++11 and C++14 mode we don't define them, because multiline
is not a reserved name in those standards.

libstdc++-v3/ChangeLog:

* include/bits/regex.h (basic_regex::multiline): Define for
non-strict C++11 and C++14 modes.
* include/bits/regex_constants.h (regex_constants::multiline):
Add _GLIBCXX_RESOLVE_LIB_DEFECTS comment.

libstdc++-v3/include/bits/regex.h
libstdc++-v3/include/bits/regex_constants.h

index 664944b0ef27073325156136fa245036e616559b..ff908da3e9422f5d5e67a9a52f2b45493202e55b 100644 (file)
@@ -424,7 +424,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
       static constexpr flag_type awk = regex_constants::awk;
       static constexpr flag_type grep = regex_constants::grep;
       static constexpr flag_type egrep = regex_constants::egrep;
-#if __cplusplus >= 201703L
+#if __cplusplus >= 201703L || !defined __STRICT_ANSI__
       static constexpr flag_type multiline = regex_constants::multiline;
 #endif
       ///@}
index af689ff93af1bcb6fbe36d3e88ccccf539fbed5b..0fd2879c81729bf81066019b53d410cf3a0b01d4 100644 (file)
@@ -171,6 +171,8 @@ namespace regex_constants
     static_cast<syntax_option_type>(1 << _S_egrep);
 
 #if __cplusplus >= 201703L || !defined __STRICT_ANSI__
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 2503. multiline option should be added to syntax_option_type
   /**
    * Specifies that the `^` anchor matches at the beginning of a line,
    * and the `$` anchor matches at the end of a line, not only at the