public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/98421] New: std::span does not detect invalid range in Debug Mode
@ 2020-12-22 15:50 redi at gcc dot gnu.org
  2021-08-31 16:35 ` [Bug libstdc++/98421] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2020-12-22 15:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98421
           Summary: std::span does not detect invalid range in Debug Mode
           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: ---

#define _GLIBCXX_DEBUG 1
#include <vector>
#include <span>

int main()
{
 std::vector<int> coll;
 coll.reserve(10);
 std::span first3{coll.begin(), 3}; // or coll.data(), 3
}

This should abort, because coll.begin()+3 is undefined, violating the
precondition of the std::span constructor.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-03 13:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 15:50 [Bug libstdc++/98421] New: std::span does not detect invalid range in Debug Mode redi at gcc dot gnu.org
2021-08-31 16:35 ` [Bug libstdc++/98421] " redi at gcc dot gnu.org
2021-08-31 18:14 ` cvs-commit at gcc dot gnu.org
2021-08-31 18:14 ` redi at gcc dot gnu.org
2021-11-24 11:51 ` cvs-commit at gcc dot gnu.org
2021-11-24 11:52 ` redi at gcc dot gnu.org
2022-08-03 12:30 ` cvs-commit at gcc dot gnu.org
2022-08-03 13:34 ` redi at gcc dot gnu.org

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).