anon2.C: New test.

* g++.dg/lookup/anon2.C: New test.

	* parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for
	anonymous structs.

From-SVN: r59647
This commit is contained in:
Joe Buck 2002-11-29 22:08:36 +00:00 committed by Mark Mitchell
parent ff944b4986
commit f6a83eb0a7
4 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-11-29 Joe Buck <jbuck@synopsys.com>
* parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for
anonymous structs.
2002-11-29 Mark Mitchell <mark@codesourcery.com>
* class.c (walk_subobject_offsets): Recur on binfos as well as on

View File

@ -2524,6 +2524,8 @@ class_head_defn:
make_anon_name (),
0));
$$.new_type_flag = 0;
CLASSTYPE_DECLARED_CLASS (TREE_TYPE ($$.t))
= $1 == class_type_node;
yyungetc ('{', 1);
}
;

View File

@ -1,3 +1,7 @@
2002-11-29 Joe Buck <jbuck@synopsys.com>
* g++.dg/lookup/anon2.C: New test.
2002-11-28 Kazu Hirata <kazu@cs.umass.edu>
* gcc.c-torture/execute/strct-varg-1.x: Remove xfail on the

View File

@ -0,0 +1,6 @@
// { dg-do compile }
// { dg-options "" }
class { int i; } a; // { dg-error "private" }
void foo() { a.i; } // { dg-error "context" }