]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/9259 (Calling a non-qualified member function within a sizeof() expression...
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>
Thu, 15 Jan 2004 23:41:41 +0000 (23:41 +0000)
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>
Thu, 15 Jan 2004 23:41:41 +0000 (23:41 +0000)
PR c++/9259
* typeck.c (build_class_member_access_expr): Allow to access members
of the currently open class.
(finish_class_member_access_expr): Likewise.

From-SVN: r75948

gcc/cp/ChangeLog
gcc/cp/typeck.c

index 91345672750b085da73bd7b83112c67fd0c3b49d..43bd29d036c7480c3f5fa4bda2f4e0ccb1f15339 100644 (file)
@@ -1,3 +1,10 @@
+2004-01-15  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
+
+       PR c++/9259
+       * typeck.c (build_class_member_access_expr): Allow to access members
+       of the currently open class.
+       (finish_class_member_access_expr): Likewise.
+
 2004-01-15  Alexandre Oliva  <aoliva@redhat.com>
 
        PR c++/13659
index ff397c0417d0d36e2b21ff946347580b92882cbe..a238eb41c8cf82b2d7748a8a17b16f89bcc9cab0 100644 (file)
@@ -1570,7 +1570,8 @@ build_class_member_access_expr (tree object, tree member,
      The type of the first expression shall be "class object" (of a
      complete type).  */
   object_type = TREE_TYPE (object);
-  if (!complete_type_or_else (object_type, object))
+  if (!currently_open_class (object_type) 
+      && !complete_type_or_else (object_type, object))
     return error_mark_node;
   if (!CLASS_TYPE_P (object_type))
     {
@@ -1856,7 +1857,8 @@ finish_class_member_access_expr (tree object, tree name)
 
      The type of the first expression shall be "class object" (of a
      complete type).  */
-  if (!complete_type_or_else (object_type, object))
+  if (!currently_open_class (object_type) 
+      && !complete_type_or_else (object_type, object))
     return error_mark_node;
   if (!CLASS_TYPE_P (object_type))
     {