diff options
author | Marek Polacek <polacek@redhat.com> | 2015-03-25 20:06:24 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-03-25 20:06:24 +0000 |
commit | 2a924bb46cd43165272ce6f1720710c38beb2c24 (patch) | |
tree | 66ac49b022061a1477eea8481de32ecf4d3735ba /gcc/cp | |
parent | b7f5cbad2eee68fb861f44f7cdbd93ae1c7c8121 (diff) | |
download | gcc-2a924bb46cd43165272ce6f1720710c38beb2c24.zip gcc-2a924bb46cd43165272ce6f1720710c38beb2c24.tar.gz gcc-2a924bb46cd43165272ce6f1720710c38beb2c24.tar.bz2 |
re PR c++/61670 (ICE on invalid in tree_nop_conversion)
PR c++/61670
* class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
* g++.dg/template/pr61670.C: New test.
From-SVN: r221671
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/class.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5b3fd49..65e1912 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-25 Marek Polacek <polacek@redhat.com> + + PR c++/61670 + * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE. + 2015-03-24 Jason Merrill <jason@redhat.com> PR c++/65046 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 0518320..c2d4201 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5434,7 +5434,8 @@ remove_zero_width_bit_fields (tree t) DECL_INITIAL (*fieldsp). check_bitfield_decl eventually sets DECL_SIZE (*fieldsp) to that width. */ - && integer_zerop (DECL_SIZE (*fieldsp))) + && (DECL_SIZE (*fieldsp) == NULL_TREE + || integer_zerop (DECL_SIZE (*fieldsp)))) *fieldsp = DECL_CHAIN (*fieldsp); else fieldsp = &DECL_CHAIN (*fieldsp); |