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
This commit is contained in:
Giovanni Bajo 2004-01-15 23:41:41 +00:00
parent c0f4b5e40e
commit 21b34b9c09
2 changed files with 11 additions and 2 deletions

View 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

View 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))
{