]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/22308 (Failure to diagnose violation of constraint 6.516p2)
authorJoseph Myers <joseph@codesourcery.com>
Tue, 5 Jul 2005 21:19:16 +0000 (22:19 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 5 Jul 2005 21:19:16 +0000 (22:19 +0100)
PR c/22308
* c-decl.c (finish_struct): Also copy C_TYPE_FIELDS_READONLY,
C_TYPE_FIELDS_VOLATILE and C_TYPE_VARIABLE_SIZE to type variants.

testsuite:
* gcc.dg/pr22308-1.c: New test.

From-SVN: r101636

gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr22308-1.c

index 5371b1c4266d2b62b35e601fde53e51f51ffa0f3..0d740abb922465d5cb31cd7282c46ea6055c2bd3 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-05  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR c/22308
+       * c-decl.c (finish_struct): Also copy C_TYPE_FIELDS_READONLY,
+       C_TYPE_FIELDS_VOLATILE and C_TYPE_VARIABLE_SIZE to type variants.
+
 2005-06-14  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR target/20301
index 619b221063b9f710e7a23b0701250acbab5cb016..8d717733ddc3a630705cb8ccc078145ea36dec0b 100644 (file)
@@ -5126,6 +5126,9 @@ finish_struct (tree t, tree fieldlist, tree attributes)
       TYPE_LANG_SPECIFIC (x) = TYPE_LANG_SPECIFIC (t);
       TYPE_ALIGN (x) = TYPE_ALIGN (t);
       TYPE_USER_ALIGN (x) = TYPE_USER_ALIGN (t);
+      C_TYPE_FIELDS_READONLY (x) = C_TYPE_FIELDS_READONLY (t);
+      C_TYPE_FIELDS_VOLATILE (x) = C_TYPE_FIELDS_VOLATILE (t);
+      C_TYPE_VARIABLE_SIZE (x) = C_TYPE_VARIABLE_SIZE (t);
     }
 
   /* If this was supposed to be a transparent union, but we can't
index 5792daea7c1d2f96dcc69f609d9e2ea0a760ab2e..7f7f494658dff4d452e4166271ff6fcaf6c6b018 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-05  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR c/22308
+       * gcc.dg/pr22308-1.c: New test.
+
 2005-06-13  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/20789
index bcbb294c2cbd274fc25b62503ef0bd0ce3776d35..ff849151d1615762282a2d6e0e52aaef8fe42c81 100644 (file)
@@ -9,5 +9,5 @@ struct foo { const int z; };
 void
 bar (void)
 {
-  t = s; /* { dg-error "error: assignment of read-only variable 't'" } */
+  t = s; /* { dg-error "error: assignment of read-only variable `t'" } */
 }