public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/107894] New: [feature request] _GLIBCXX_ASSERTIONS for std::optional
@ 2022-11-28 10:27 tim at klingt dot org
  2022-11-28 11:08 ` [Bug libstdc++/107894] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: tim at klingt dot org @ 2022-11-28 10:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107894
           Summary: [feature request] _GLIBCXX_ASSERTIONS for
                    std::optional
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tim at klingt dot org
  Target Milestone: ---

`_GLIBCXX_ASSERTIONS` does not enable any API validation for std::optional.
e.g. `operator->` translates to `address_to`:
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/optional#L969-L970

libc++ on the other hand has assertions that can detect invalid uses:
https://github.com/llvm/llvm-project/blob/main/libcxx/include/optional#L930-L937


it would be great if libstdc++ could perform the same validation

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

end of thread, other threads:[~2022-11-28 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28 10:27 [Bug libstdc++/107894] New: [feature request] _GLIBCXX_ASSERTIONS for std::optional tim at klingt dot org
2022-11-28 11:08 ` [Bug libstdc++/107894] " 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).