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
This commit is contained in:
Marek Polacek 2015-03-25 20:06:24 +00:00 committed by Marek Polacek
parent b7f5cbad2e
commit 2a924bb46c
4 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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);

View File

@ -1,3 +1,8 @@
2015-03-25 Marek Polacek <polacek@redhat.com>
PR c++/61670
* g++.dg/template/pr61670.C: New test.
2015-03-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54987

View File

@ -0,0 +1,9 @@
// PR c++/61670
// { dg-do compile }
template <class>
class A {
A: 0 // { dg-error "" }
};
A<int> a;