aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-06-23 12:52:41 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-06-23 12:52:41 -0400
commitece620047b5ef8033e0c066c73c857a4d820d507 (patch)
treef52930c944813f38597dfd3a856741487b7ca3b0 /gcc/cp
parentd708df29c844a491bcb9ec44a839b0c9b0b2010f (diff)
downloadgcc-ece620047b5ef8033e0c066c73c857a4d820d507.zip
gcc-ece620047b5ef8033e0c066c73c857a4d820d507.tar.gz
gcc-ece620047b5ef8033e0c066c73c857a4d820d507.tar.bz2
re PR c++/49395 (Non-class prvalues seem to have cv-qualification with GCC)
PR c++/49395 * init.c (build_zero_init_1): Strip cv-quals from scalar types. From-SVN: r175339
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/init.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 64a5807..a8fbf7b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2011-06-23 Jason Merrill <jason@redhat.com>
+ PR c++/49395
+ * init.c (build_zero_init_1): Strip cv-quals from scalar types.
+
PR c++/36435
* pt.c (most_specialized_instantiation): Do check return types.
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 3c347a4..62b68f2 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -176,7 +176,7 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
initialized are initialized to zero. */
;
else if (SCALAR_TYPE_P (type))
- init = convert (type, integer_zero_node);
+ init = convert (cv_unqualified (type), integer_zero_node);
else if (CLASS_TYPE_P (type))
{
tree field;