[llvm-bugs] [Bug 45103] New: std::copy failed to copy with volatile types on all LLVM versions. Same issue with GCC 10.0

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 4 13:18:07 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=45103

            Bug ID: 45103
           Summary: std::copy failed to copy with volatile types on all
                    LLVM versions. Same issue with GCC 10.0
           Product: libc++
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: euloanty at live.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

libc++ has this bug all the time while GCC has this issue since GCC 10.0.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94013
https://godbolt.org/z/YLtbCj


#include<array>
void f()
{
    std::array<int volatile,3> arr{};
    std::copy(arr.cbegin(),arr.cend(),arr.begin());
}

In file included from <source>:1:

In file included from
/opt/compiler-explorer/clang-trunk-20200304/bin/../include/c++/v1/array:111:

/opt/compiler-explorer/clang-trunk-20200304/bin/../include/c++/v1/algorithm:1725:24:
error: cannot initialize a parameter of type 'void *' with an lvalue of type
'volatile int *'

        _VSTD::memmove(__result, __first, __n * sizeof(_Up));

                       ^~~~~~~~

/opt/compiler-explorer/clang-trunk-20200304/bin/../include/c++/v1/algorithm:1738:23:
note: in instantiation of function template specialization
'std::__1::__copy<const volatile int, volatile int>' requested here

        return _VSTD::__copy(

                      ^

/usr/include/string.h:46:29: note: passing argument to parameter '__dest' here

extern void *memmove (void *__dest, const void *__src, size_t __n)

                            ^

1 error generated.

Compiler returned: 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200304/698d9434/attachment.html>


More information about the llvm-bugs mailing list