aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/init.c4
-rw-r--r--gcc/cp/typeck.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/other/bitfield2.C9
5 files changed, 24 insertions, 2 deletions
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 <reichelt@igpm.rwth-aachen.de>
+
+ 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 <mark@codesourcery.com>
* 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));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5491dbe..4aa506f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-20 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28052
+ * g++.dg/other/bitfield2.C: New test.
+
2006-06-20 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/27331
diff --git a/gcc/testsuite/g++.dg/other/bitfield2.C b/gcc/testsuite/g++.dg/other/bitfield2.C
new file mode 100644
index 0000000..cd9a837
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/bitfield2.C
@@ -0,0 +1,9 @@
+// PR c++/28052
+// { dg-do compile }
+
+struct A
+{
+ double d : 2; // { dg-error "non-integral" }
+ A() {}
+ ~A() {}
+};