<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - std::copy failed to copy with volatile types on all LLVM versions. Same issue with GCC 10.0"
   href="https://bugs.llvm.org/show_bug.cgi?id=45103">45103</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::copy failed to copy with volatile types on all LLVM versions. Same issue with GCC 10.0
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>euloanty@live.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>libc++ has this bug all the time while GCC has this issue since GCC 10.0.

<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94013">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94013</a>
<a href="https://godbolt.org/z/YLtbCj">https://godbolt.org/z/YLtbCj</a>


#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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>