From 2e5d297000e914b5132c50f5569ddc13a5512598 Mon Sep 17 00:00:00 2001 From: Volker Reichelt Date: Tue, 20 Jun 2006 13:02:47 +0000 Subject: re PR c++/28052 (ICE on invalid bitfield) PR c++/28052 * init.c (push_base_cleanups): Skip members with invalid types. * typeck.c (build_class_member_access_expr): Robustify. * g++.dg/other/bitfield2.C: New test. From-SVN: r114811 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/init.c | 4 +++- gcc/cp/typeck.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 72a723f..7f022ad 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2006-06-20 Volker Reichelt + + PR c++/28052 + * init.c (push_base_cleanups): Skip members with invalid types. + * typeck.c (build_class_member_access_expr): Robustify. + 2006-06-19 Mark Mitchell * pt.c (instantiate_template): Fix typo in comment. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 590036b..357cba9 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2898,7 +2898,9 @@ push_base_cleanups (void) for (member = TYPE_FIELDS (current_class_type); member; member = TREE_CHAIN (member)) { - if (TREE_CODE (member) != FIELD_DECL || DECL_ARTIFICIAL (member)) + if (TREE_TYPE (member) == error_mark_node + || TREE_CODE (member) != FIELD_DECL + || DECL_ARTIFICIAL (member)) continue; if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (member))) { diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index d50c08b..f993bf7 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1723,7 +1723,7 @@ build_class_member_access_expr (tree object, tree member, tree member_scope; tree result = NULL_TREE; - if (object == error_mark_node || member == error_mark_node) + if (error_operand_p (object) || error_operand_p (member)) return error_mark_node; gcc_assert (DECL_P (member) || BASELINK_P (member)); -- cgit v1.1