Commit c663bc6a by Jason Merrill Committed by Jason Merrill

re PR c++/60872 (Cannot memcpy array of restricted pointers)

	PR c++/60872
	* call.c (standard_conversion): Don't try to apply restrict to void.

From-SVN: r209520
parent 8a3a7e67
2014-04-18 Jason Merrill <jason@redhat.com>
PR c++/60872
* call.c (standard_conversion): Don't try to apply restrict to void.
2014-04-16 Marc Glisse <marc.glisse@inria.fr>
* decl.c (reshape_init_r): Handle a single element of vector type.
......
......@@ -1196,9 +1196,10 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
&& TREE_CODE (TREE_TYPE (from)) != FUNCTION_TYPE)
{
tree nfrom = TREE_TYPE (from);
/* Don't try to apply restrict to void. */
int quals = cp_type_quals (nfrom) & ~TYPE_QUAL_RESTRICT;
from = build_pointer_type
(cp_build_qualified_type (void_type_node,
cp_type_quals (nfrom)));
(cp_build_qualified_type (void_type_node, quals));
conv = build_conv (ck_ptr, from, conv);
}
else if (TYPE_PTRDATAMEM_P (from))
......
// PR c++/60872
// { dg-options "" }
typedef double *__restrict T;
void f(T* p)
{
void *p2 = p;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment