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

            Bug ID: 105651
           Summary: Failure compiling constexpr/__builtin_memcpy on Cygwin
                    with -std=c++20
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mckelvey at maskull dot com
  Target Milestone: ---

Created attachment 52990
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52990&action=edit
Build.log showing error

$ /usr/local/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-cygwin/13.0.0/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: ./configure --enable-languages=c,c++ --enable-threads=posix
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20220515 (experimental) (GCC)

$ uname
CYGWIN_NT-10.0

Windows 10.

Builds on gcc-11,12,13 with -std=c++17, but all three fail with c++20.

In file included from /usr/local/include/c++/13.0.0/string:40,
                 from /usr/local/include/c++/13.0.0/bits/locale_classes.h:40,
                 from /usr/local/include/c++/13.0.0/locale:39,
                 from Types.h:36,
                 from PatternDriverTop.h:42,
                 from PatternDriverTop.cc:28:
In static member function ‘static constexpr std::char_traits<char>::char_type*
std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)’,
    inlined from ‘static void std::basic_string<_CharT, _Traits,
_Alloc>::_M_copy(_CharT*, const _CharT*, size_type) [with _CharT = char;
_Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at
/usr/local/include/c++/13.0.0/bits/cow_string.h:402:21,
    inlined from ‘std::basic_string<_CharT, _Traits, _Alloc>&
std::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*,
size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc =
std::allocator<char>]’ at
/usr/local/include/c++/13.0.0/bits/cow_string.h:3297:16,
    inlined from ‘std::basic_string<_CharT, _Traits, _Alloc>&
std::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*)
[with _CharT = char; _Traits = std::char_traits<char>; _Alloc =
std::allocator<char>]’ at
/usr/local/include/c++/13.0.0/bits/cow_string.h:1609:21,
    inlined from ‘PatternDriver::pdstring
PatternDriver::_printable_by_ctype(const pdstring&, const std::locale&, const
pdctype&, bool, bool)’ at PatternDriverTop.cc:589:22:
/usr/local/include/c++/13.0.0/bits/char_traits.h:431:56: error: ‘void*
__builtin_memcpy(void*, const void*, long unsigned int)’ accessing
9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may
overlap up to 9223372036854775813 bytes at offset -3 [-Werror=restrict]
  431 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2,
__n));
      |                                       
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Reply via email to