public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/114925] New: include/bits/fs_path.h#L841 deprecation note suggests UB
@ 2024-05-02 15:07 fabian_kessler at gmx dot de
  2024-05-02 15:17 ` [Bug libstdc++/114925] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: fabian_kessler at gmx dot de @ 2024-05-02 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114925
           Summary: include/bits/fs_path.h#L841 deprecation note suggests
                    UB
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fabian_kessler at gmx dot de
  Target Milestone: ---

```
template<typename _Source,
           typename _Require = __detail::_Path<_Source>,
           typename _CharT =
__detail::__value_type_is_char_or_char8_t<_Source>>
    _GLIBCXX20_DEPRECATED_SUGGEST("path((const char8_t*)&*source)")
    inline path
    u8path(const _Source& __source)
```

This is clearly undefined behavior, since it breaks aliasing rules. Even if
it's implementation vise ok, it might not be correct with other compilers.

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

end of thread, other threads:[~2024-05-02 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 15:07 [Bug libstdc++/114925] New: include/bits/fs_path.h#L841 deprecation note suggests UB fabian_kessler at gmx dot de
2024-05-02 15:17 ` [Bug libstdc++/114925] " pinskia at gcc dot gnu.org
2024-05-02 15:58 ` fabian_kessler at gmx dot de
2024-05-02 16:59 ` 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).