Commit e0fed25b by Danny Smith Committed by Danny Smith

re PR c++/9021 ([win32] No exports possible when using a class pointer in an union)

	PR c++/9021
  	PR c++/11005
	* parser.c (cp_parser_elaborated_type_specifier): Warn about
	attributes and discard.
	* decl.c (xref_tag): Don't overwite existing attributes with
	NULL_TREE.

From-SVN: r75846
parent 79551a56
2004-01-14 Danny Smith <dannysmith@users,sourceforge.net>
PR c++/9021
PR c++/11005
* parser.c (cp_parser_elaborated_type_specifier): Warn about
attributes and discard.
* decl.c (xref_tag): Don't overwite existing attributes with
NULL_TREE.
2004-01-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/12335
......
/* Process declarations and variables for C++ compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003 Free Software Foundation, Inc.
2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
......@@ -9477,7 +9477,15 @@ xref_tag (enum tag_types tag_code, tree name, tree attributes,
redeclare_class_template (t, current_template_parms);
}
TYPE_ATTRIBUTES (t) = attributes;
/* Add attributes only when defining a class. */
if (attributes)
{
/* The only place that xref_tag is called with non-null
attributes is in cp_parser_class_head(), when defining a
class. */
my_friendly_assert (TYPE_ATTRIBUTES (t) == NULL_TREE, 20040113);
TYPE_ATTRIBUTES (t) = attributes;
}
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
}
......
......@@ -9065,8 +9065,12 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
definition of a new type; a new type can only be declared in a
declaration context. */
/* Warn about attributes. They are ignored. */
if (attributes)
warning ("type attributes are honored only at type definition");
type = xref_tag (tag_type, identifier,
attributes,
/*attributes=*/NULL_TREE,
(is_friend
|| !is_declaration
|| cp_lexer_next_token_is_not (parser->lexer,
......
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