Commit 1e30f9b4 by Mark Mitchell Committed by Mark Mitchell

class.c (check_bitfield_decl): New function, split out from finish_stuct_1.

	* class.c (check_bitfield_decl): New function, split out from
	finish_stuct_1.
	(check_field_decl): Likewise.  Recursively examine members of
	anonymous structs.
	(finish_struct_1): Use them.
	* cp-tree.h (ANON_UNION_TYPE_P): New macro.

From-SVN: r30381
parent 4b66e1c0
1999-11-03 Mark Mitchell <mark@codesourcery.com>
* class.c (check_bitfield_decl): New function, split out from
finish_stuct_1.
(check_field_decl): Likewise. Recursively examine members of
anonymous structs.
(finish_struct_1): Use them.
* cp-tree.h (ANON_UNION_TYPE_P): New macro.
1999-11-02 Mark Mitchell <mark@codesourcery.com> 1999-11-02 Mark Mitchell <mark@codesourcery.com>
* decl.c (grokfndecl): Remove dead code. * decl.c (grokfndecl): Remove dead code.
......
...@@ -2321,6 +2321,10 @@ extern int flag_new_for_scope; ...@@ -2321,6 +2321,10 @@ extern int flag_new_for_scope;
#define SET_ANON_AGGR_TYPE_P(NODE) \ #define SET_ANON_AGGR_TYPE_P(NODE) \
(TYPE_LANG_SPECIFIC (NODE)->anon_aggr = 1) (TYPE_LANG_SPECIFIC (NODE)->anon_aggr = 1)
/* Nonzero if TYPE is an anonymous union type. */
#define ANON_UNION_TYPE_P(NODE) \
(TREE_CODE (NODE) == UNION_TYPE && ANON_AGGR_TYPE_P (NODE))
/* For a VAR_DECL that is an anonymous union, these are the various /* For a VAR_DECL that is an anonymous union, these are the various
sub-variables that make up the anonymous union. */ sub-variables that make up the anonymous union. */
#define DECL_ANON_UNION_ELEMS(NODE) DECL_ARGUMENTS ((NODE)) #define DECL_ANON_UNION_ELEMS(NODE) DECL_ARGUMENTS ((NODE))
......
// Build don't link:
// Special g++ Options:
struct S
{
S ();
};
union U {
struct {
S s; // ERROR - struct with constructor in union
};
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment