aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Millward <lee.millward@gmail.com>2006-06-22 17:48:41 +0000
committerLee Millward <lmillward@gcc.gnu.org>2006-06-22 17:48:41 +0000
commita8fe5a30f21979b1c444c31668bf3aef157aefa3 (patch)
tree5a8f84ecee087a2e0fb9afddef44ed1befab7787
parent6d82bb8521a4707e6614523956e83307f5718792 (diff)
downloadgcc-a8fe5a30f21979b1c444c31668bf3aef157aefa3.zip
gcc-a8fe5a30f21979b1c444c31668bf3aef157aefa3.tar.gz
gcc-a8fe5a30f21979b1c444c31668bf3aef157aefa3.tar.bz2
re PR c++/27805 (ICE with ptr-to-member of incomplete class)
PR c++/27805 * typeck2.c (build_m_component_ref): Use error_operand_p. From-SVN: r114897
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck2.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/parse/ptrmem6.C11
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ec07436..96d7123 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-22 Lee Millward <lee.millward@gmail.com>
+
+ PR c++/27805
+ * typeck2.c (build_m_component_ref): Use error_operand_p.
+
2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28111
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index f4de802..6ad4e83 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1200,7 +1200,7 @@ build_m_component_ref (tree datum, tree component)
tree binfo;
tree ctype;
- if (datum == error_mark_node || component == error_mark_node)
+ if (error_operand_p (datum) || error_operand_p (component))
return error_mark_node;
ptrmem_type = TREE_TYPE (component);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 013608b..1bab6ae 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-22 Lee Millward <lee.millward@gmail.com>
+
+ PR c++/27805
+ * g++.dg/parse/ptrmem6.C: New test.
+
2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28111
diff --git a/gcc/testsuite/g++.dg/parse/ptrmem6.C b/gcc/testsuite/g++.dg/parse/ptrmem6.C
new file mode 100644
index 0000000..6dac21c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/ptrmem6.C
@@ -0,0 +1,11 @@
+//PR C++/27805
+
+struct A;
+
+void foo()
+{
+ int A::* p;
+ A a; // { dg-error "incomplete type" }
+ a.*p;
+}
+