From: Giovanni Bajo Date: Thu, 15 Jan 2004 23:41:41 +0000 (+0000) Subject: re PR c++/9259 (Calling a non-qualified member function within a sizeof() expression... X-Git-Tag: releases/gcc-3.4.0~929 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=21b34b9c09fe1e62446820345b82ac0cabe284c3;p=thirdparty%2Fgcc.git re PR c++/9259 (Calling a non-qualified member function within a sizeof() expression leads to "invalid use of undefined type") 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 91345672750b..43bd29d036c7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-01-15 Giovanni Bajo + + 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 PR c++/13659 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index ff397c0417d0..a238eb41c8cf 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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)) {