[Bug c++/60872] Cannot memcpy array of restricted pointers

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 17 12:37:00 GMT 2014


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase:
typedef double * __restrict__ T;

void bar (void *);

void
foo (T *a)
{
  bar (a);
}

Whether this is valid C++ or not will leave to our C++ folks.  Not a regression
of any kind, even g++ 3.2 fails the same way.
Note that in C, you get a warning for this and with explicit cast (bar ((void
*) a);) it is accepted without diagnostics.  In C++ it errors even for that,
and for the various C++ *_cast <void *> (a).



More information about the Gcc-bugs mailing list