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.

Reply via email to