Commit b537d120 by Mark Mitchell Committed by Mark Mitchell

decl.c (grokdeclarator): Don't give names "for linkage purposes" to anonymous cv-qualified types.

	* decl.c (grokdeclarator): Don't give names "for linkage purposes"
	to anonymous cv-qualified types.

From-SVN: r27891
parent c05fb06e
1999-07-01 Mark Mitchell <mark@codesourcery.com>
* decl.c (grokdeclarator): Don't give names "for linkage purposes"
to anonymous cv-qualified types.
1999-07-01 Gavin Romig-Koch <gavin@cygnus.com> 1999-07-01 Gavin Romig-Koch <gavin@cygnus.com>
* lex.c (real_yylex) : Change integer literal overflow handling to * lex.c (real_yylex) : Change integer literal overflow handling to
......
...@@ -11064,14 +11064,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -11064,14 +11064,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (type != error_mark_node if (type != error_mark_node
&& TYPE_NAME (type) && TYPE_NAME (type)
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& ANON_AGGRNAME_P (TYPE_IDENTIFIER (type))) && ANON_AGGRNAME_P (TYPE_IDENTIFIER (type))
&& CP_TYPE_QUALS (type) == TYPE_UNQUALIFIED)
{ {
tree oldname = TYPE_NAME (type); tree oldname = TYPE_NAME (type);
tree t; tree t;
/* FIXME: This is bogus; we should not be doing this for
cv-qualified types. */
/* Replace the anonymous name with the real name everywhere. */ /* Replace the anonymous name with the real name everywhere. */
lookup_tag_reverse (type, declarator); lookup_tag_reverse (type, declarator);
for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t)) for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
......
// Build don't link:
// Special g++ Options: -g
typedef volatile struct {
int i;
} mutex_t;
...@@ -4,9 +4,9 @@ typedef const struct { ...@@ -4,9 +4,9 @@ typedef const struct {
int x; int x;
} Test; } Test;
void foo(Test); static void foo(Test);
void foo(Test t) static void foo(Test t)
{ {
t.x = 0; // ERROR - assignment of read-only member t.x = 0; // ERROR - assignment of read-only member
return; return;
......
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