public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60872] New: Cannot memcpy array of restricted pointers
@ 2014-04-17 12:14 e.tadeu at gmail dot com
  2014-04-17 12:37 ` [Bug c++/60872] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: e.tadeu at gmail dot com @ 2014-04-17 12:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60872

            Bug ID: 60872
           Summary: Cannot memcpy array of restricted pointers
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: e.tadeu at gmail dot com

When trying to use memcpy to copy arrays of restricted pointers, it fails with
the message:


  error: '__restrict_' qualifiers cannot be applied to 'void'


This is a failing testcase:

#include <iostream>
#include <cstring>

typedef double* __restrict__ T;

void do_copy(T* a, const T* b)
{
    memcpy(a, b, sizeof(T) * 3);
}

int main()
{
    double x[3] = {1.5, 2.5, 3.5};

    double *p0[3] = {&x[2], &x[1], &x[0]};
    double *p1[3];

    do_copy(p1, p0);

    std::cout << *p1[2] << std::endl;

    return 0;
}


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

end of thread, other threads:[~2014-08-07 18:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-17 12:14 [Bug c++/60872] New: Cannot memcpy array of restricted pointers e.tadeu at gmail dot com
2014-04-17 12:37 ` [Bug c++/60872] " jakub at gcc dot gnu.org
2014-04-18 18:11 ` jason at gcc dot gnu.org
2014-04-19  5:10 ` jason at gcc dot gnu.org
2014-08-07 18:55 ` jason at gcc dot gnu.org
2014-08-07 18:56 ` jason 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).