* c-decl.c (build_compound_literal): Set decl TREE_READONLY from TYPE.
authorJakub Jelinek <jakub@redhat.com>
Mon, 22 Jul 2002 10:15:49 +0000 (12:15 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 22 Jul 2002 10:15:49 +0000 (12:15 +0200)
From-SVN: r55646

gcc/ChangeLog
gcc/c-decl.c

index 44bf4e18e02f0803da9cf9a1c39ee62ca1d1b860..74205f6a76f07fe45bc9d905bf072dadf7cfeda5 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-22  Jakub Jelinek  <jakub@redhat.com>
+
+       * c-decl.c (build_compound_literal): Set decl TREE_READONLY from TYPE.
+
 2002-07-22  Jakub Jelinek  <jakub@redhat.com>
 
        * c-decl.c (build_compound_literal): Defer compound literal decls
index 57af611011f9ab642d6178329dadbaac079f9994..f4f995704b6a292f493b693119322f519f09f259 100644 (file)
@@ -3647,6 +3647,7 @@ build_compound_literal (type, init)
   DECL_CONTEXT (decl) = current_function_decl;
   TREE_USED (decl) = 1;
   TREE_TYPE (decl) = type;
+  TREE_READONLY (decl) = TREE_READONLY (type);
   store_init_value (decl, init);
 
   if (TREE_CODE (type) == ARRAY_TYPE && !COMPLETE_TYPE_P (type))