aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-07-01 16:36:59 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-07-01 16:36:59 +0000
commitb537d12084f7aba41c814b0bcf0edf5d0ac3a159 (patch)
treee092c58a15de341e050673d3f489a6de4820898a /gcc
parentc05fb06e322102bee103b2d5843f8e546400dbf0 (diff)
downloadgcc-b537d12084f7aba41c814b0bcf0edf5d0ac3a159.zip
gcc-b537d12084f7aba41c814b0bcf0edf5d0ac3a159.tar.gz
gcc-b537d12084f7aba41c814b0bcf0edf5d0ac3a159.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/debug4.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/typedef1.C4
4 files changed, 15 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 25a0005..e3ea60d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 0a838ed..b7a36de 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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
index 0000000..07f606d
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/debug4.C
@@ -0,0 +1,6 @@
+// Build don't link:
+// Special g++ Options: -g
+
+typedef volatile struct {
+ int i;
+} mutex_t;
diff --git a/gcc/testsuite/g++.old-deja/g++.other/typedef1.C b/gcc/testsuite/g++.old-deja/g++.other/typedef1.C
index d447729..b9ebac2 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/typedef1.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/typedef1.C
@@ -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;