public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-10122] libstdc++: Define basic_regex::multiline for non-strict modes
Date: Thu,  7 Jul 2022 23:32:34 +0000 (GMT)	[thread overview]
Message-ID: <20220707233234.9558E384B836@sourceware.org> (raw)

https://gcc.gnu.org/g:43d10cce34281e420fa6bdeb9765e83ba79b1aad

commit r11-10122-g43d10cce34281e420fa6bdeb9765e83ba79b1aad
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 1 14:06:42 2021 +0100

    libstdc++: Define basic_regex::multiline for non-strict modes
    
    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.
    
    (cherry picked from commit 17374dab3eefd282977ad90743c9aff97f2e41ce)

Diff:
---
 libstdc++-v3/include/bits/regex.h           | 2 +-
 libstdc++-v3/include/bits/regex_constants.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index f794a0f8f00..1ae089c351f 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -414,7 +414,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
       ///@}
diff --git a/libstdc++-v3/include/bits/regex_constants.h b/libstdc++-v3/include/bits/regex_constants.h
index af689ff93af..0fd2879c817 100644
--- a/libstdc++-v3/include/bits/regex_constants.h
+++ b/libstdc++-v3/include/bits/regex_constants.h
@@ -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


                 reply	other threads:[~2022-07-07 23:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220707233234.9558E384B836@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).