* decl.c (grokdeclarator): Don't give names "for linkage purposes"
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Jul 1999 16:36:59 +0000 (16:36 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Jul 1999 16:36:59 +0000 (16:36 +0000)
to anonymous cv-qualified types.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27891 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.old-deja/g++.other/debug4.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/typedef1.C

index 25a0005..e3ea60d 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        * lex.c (real_yylex) : Change integer literal overflow handling to
index 0a838ed..b7a36de 100644 (file)
@@ -11064,14 +11064,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
       if (type != error_mark_node
          && TYPE_NAME (type)
          && 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 t;
 
-         /* FIXME: This is bogus; we should not be doing this for
-                   cv-qualified types.  */
-
          /* Replace the anonymous name with the real name everywhere.  */
          lookup_tag_reverse (type, declarator);
          for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
diff --git a/gcc/testsuite/g++.old-deja/g++.other/debug4.C b/gcc/testsuite/g++.old-deja/g++.other/debug4.C
new file mode 100644 (file)
index 0000000..07f606d
--- /dev/null
@@ -0,0 +1,6 @@
+// Build don't link:
+// Special g++ Options: -g
+
+typedef volatile struct {
+       int i;
+} mutex_t;
index d447729..b9ebac2 100644 (file)
@@ -4,9 +4,9 @@ typedef const struct {
    int x;
 } 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
   return;