[Bug libstdc++/107894] New: [feature request] _GLIBCXX_ASSERTIONS for std::optional
tim at klingt dot org
gcc-bugzilla@gcc.gnu.org
Mon Nov 28 10:27:51 GMT 2022
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
More information about the Gcc-bugs
mailing list