Commit 57cfc5dd by Jason Merrill Committed by Jason Merrill

parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.

	* parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
Fixes Sec14/5/P14139.C

From-SVN: r23765
parent 0b5be897
1998-11-23 Jason Merrill <jason@yorick.cygnus.com>
* parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS.
* class.c (finish_struct_1): Set things up for 0-width bitfields
like we do for others.
......
......@@ -2242,12 +2242,17 @@ named_class_head:
{
pop_scope (CP_DECL_CONTEXT ($1));
$$ = TREE_TYPE ($1);
if (TREE_INT_CST_LOW (current_aggr) == union_type
if (current_aggr == union_type_node
&& TREE_CODE ($$) != UNION_TYPE)
cp_pedwarn ("`union' tag used in declaring `%#T'", $$);
else if (TREE_CODE ($$) == UNION_TYPE
&& TREE_INT_CST_LOW (current_aggr) != union_type)
&& current_aggr != union_type_node)
cp_pedwarn ("non-`union' tag used in declaring `%#T'", $$);
else if (TREE_CODE ($$) == RECORD_TYPE)
/* We might be specializing a template with a different
class-key; deal. */
CLASSTYPE_DECLARED_CLASS ($$) = (current_aggr
== class_type_node);
if ($3)
{
maybe_process_partial_specialization ($$);
......
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