From: Mark Mitchell Date: Thu, 1 Jul 1999 16:36:59 +0000 (+0000) Subject: decl.c (grokdeclarator): Don't give names "for linkage purposes" to anonymous cv... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b537d12084f7aba41c814b0bcf0edf5d0ac3a159;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 25a0005bb5b..e3ea60ded62 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1999-07-01 Mark Mitchell + + * decl.c (grokdeclarator): Don't give names "for linkage purposes" + to anonymous cv-qualified types. + 1999-07-01 Gavin Romig-Koch * lex.c (real_yylex) : Change integer literal overflow handling to diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0a838ed75aa..b7a36de4021 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 00000000000..07f606db1f2 --- /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 d44772932ed..b9ebac2f22d 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;