aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2014-02-01 09:24:42 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2014-02-01 09:24:42 +0000
commit4244ec23df13380a2e1e5377b9e7dc54b3bf7c8b (patch)
tree5fdfa0dfb13d548d638ae8ccb316b2f23bb5f881 /gcc
parent021293cb5abbe2a03c36bb5324ef2ebebcc98c9d (diff)
downloadgcc-4244ec23df13380a2e1e5377b9e7dc54b3bf7c8b.zip
gcc-4244ec23df13380a2e1e5377b9e7dc54b3bf7c8b.tar.gz
gcc-4244ec23df13380a2e1e5377b9e7dc54b3bf7c8b.tar.bz2
re PR c++/51219 (ICE with empty bit-fields)
/cp 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51219 * typeck2.c (process_init_constructor_record): Just skip unnamed bit-fields. /testsuite 2014-02-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51219 * g++.dg/init/bitfield5.C: New. From-SVN: r207383
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck2.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/init/bitfield5.C12
4 files changed, 24 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c10c294..2e09c88 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51219
+ * typeck2.c (process_init_constructor_record): Just skip unnamed
+ bit-fields.
+
2014-01-31 Jason Merrill <jason@redhat.com>
PR c++/59469
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index a3fe2e3..546b83f 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1268,11 +1268,7 @@ process_init_constructor_record (tree type, tree init,
tree type;
if (!DECL_NAME (field) && DECL_C_BIT_FIELD (field))
- {
- flags |= picflag_from_initializer (integer_zero_node);
- CONSTRUCTOR_APPEND_ELT (v, field, integer_zero_node);
- continue;
- }
+ continue;
if (TREE_CODE (field) != FIELD_DECL || DECL_ARTIFICIAL (field))
continue;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3024259..5cee1fe 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51219
+ * g++.dg/init/bitfield5.C: New.
+
2014-02-01 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/60003
diff --git a/gcc/testsuite/g++.dg/init/bitfield5.C b/gcc/testsuite/g++.dg/init/bitfield5.C
new file mode 100644
index 0000000..58f686d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/bitfield5.C
@@ -0,0 +1,12 @@
+// PR c++/51219
+
+struct A
+{
+ int i;
+ int : 8;
+};
+
+void foo()
+{
+ A a = { 0 };
+}