public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/99942] New: [8/9/10/11 Regression] COW std::string::data() is noexcept but can throw
Date: Tue, 06 Apr 2021 16:24:48 +0000	[thread overview]
Message-ID: <bug-99942-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99942

            Bug ID: 99942
           Summary: [8/9/10/11 Regression] COW std::string::data() is
                    noexcept but can throw
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

The C++17 non-const data() was fixed for PR 86169 so that it un-shares the
string if needed. However, this means it can reallocate, and so should not be
marked noexcept.

The right fix is probably just to remove 'noexcept', but we might also want to
consider not providing that member function at all for the COW string.

             reply	other threads:[~2021-04-06 16:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 16:24 redi at gcc dot gnu.org [this message]
2021-04-06 16:25 ` [Bug libstdc++/99942] " redi at gcc dot gnu.org
2021-04-08 14:23 ` rguenth at gcc dot gnu.org
2021-05-14  9:54 ` [Bug libstdc++/99942] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:20 ` rguenth at gcc dot gnu.org
2021-09-25 20:11 ` redi at gcc dot gnu.org
2022-05-27  9:44 ` [Bug libstdc++/99942] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:44 ` jakub at gcc dot gnu.org
2023-07-07 10:39 ` [Bug libstdc++/99942] [11/12/13/14 " rguenth at gcc dot gnu.org

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=bug-99942-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).