Commit 908e152c by Jason Merrill Committed by Jason Merrill

re PR c++/49418 (G++ discards cv-quals from template parameter types)

	PR c++/49418
	* typeck2.c (build_functional_cast): Strip cv-quals for value init.
	* init.c (build_zero_init_1): Not here.

From-SVN: r175368
parent cb77790a
2011-06-23 Jason Merrill <jason@redhat.com> 2011-06-23 Jason Merrill <jason@redhat.com>
PR c++/49519
* typeck2.c (build_functional_cast): Strip cv-quals for value init.
* init.c (build_zero_init_1): Not here.
PR c++/35255 PR c++/35255
* pt.c (resolve_overloaded_unification): Fix DR 115 handling. * pt.c (resolve_overloaded_unification): Fix DR 115 handling.
......
...@@ -176,7 +176,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p, ...@@ -176,7 +176,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
initialized are initialized to zero. */ initialized are initialized to zero. */
; ;
else if (SCALAR_TYPE_P (type)) else if (SCALAR_TYPE_P (type))
init = convert (cv_unqualified (type), integer_zero_node); init = convert (type, integer_zero_node);
else if (CLASS_TYPE_P (type)) else if (CLASS_TYPE_P (type))
{ {
tree field; tree field;
......
...@@ -1641,7 +1641,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain) ...@@ -1641,7 +1641,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
{ {
if (VOID_TYPE_P (type)) if (VOID_TYPE_P (type))
return void_zero_node; return void_zero_node;
return build_value_init (type, complain); return build_value_init (cv_unqualified (type), complain);
} }
/* This must build a C cast. */ /* This must build a C cast. */
......
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