OSDN Git Service

PR c++/27805
authorlmillward <lmillward@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jun 2006 17:48:41 +0000 (17:48 +0000)
committerlmillward <lmillward@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Jun 2006 17:48:41 +0000 (17:48 +0000)
* typeck2.c (build_m_component_ref): Use error_operand_p.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114897 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/ptrmem6.C [new file with mode: 0644]

index ec07436..96d7123 100644 (file)
@@ -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
index f4de802..6ad4e83 100644 (file)
@@ -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);
index 013608b..1bab6ae 100644 (file)
@@ -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 (file)
index 0000000..6dac21c
--- /dev/null
@@ -0,0 +1,11 @@
+//PR C++/27805
+
+struct A;
+
+void foo()
+{
+    int A::* p;
+    A a; // { dg-error "incomplete type" }
+    a.*p;
+} 
+