]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.c (decl_attributes, [...]): Allow arrays of classes, too.
authorJason Merrill <jason@yorick.cygnus.com>
Fri, 9 Apr 1999 12:43:24 +0000 (12:43 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 9 Apr 1999 12:43:24 +0000 (08:43 -0400)
* c-common.c (decl_attributes, A_INIT_PRIORITY): Allow arrays
of classes, too.

From-SVN: r26312

gcc/ChangeLog
gcc/c-common.c

index 6060ff964b131813a8048e1d5a0b61e3c7495474..85e390dccd2badc6fc8a26a0595c2ca48ed1a371 100644 (file)
@@ -1,3 +1,8 @@
+Fri Apr  9 11:18:55 1999  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * c-common.c (decl_attributes, A_INIT_PRIORITY): Allow arrays
+       of classes, too.
+
 Fri Apr  9 10:40:10 1999  Kaveh R. Ghazi  <ghazi@snafu.rutgers.edu>
 
        * rs6000.c (rs6000_override_options, ptt, rs6000_file_start,
index 8ea14899a259bf72564bbd2979f107c5ce99199c..18fc72934a3d78bdcb8bb26d08642d13a73d3727 100644 (file)
@@ -930,11 +930,14 @@ decl_attributes (node, attributes, prefix_attributes)
 
            pri = TREE_INT_CST_LOW (initp_expr);
        
+           while (TREE_CODE (type) == ARRAY_TYPE)
+             type = TREE_TYPE (type);
+
            if (is_type || TREE_CODE (decl) != VAR_DECL
                || ! TREE_STATIC (decl)
                || DECL_EXTERNAL (decl)
-               || (TREE_CODE (TREE_TYPE (decl)) != RECORD_TYPE
-                   && TREE_CODE (TREE_TYPE (decl)) != UNION_TYPE)
+               || (TREE_CODE (type) != RECORD_TYPE
+                   && TREE_CODE (type) != UNION_TYPE)
                /* Static objects in functions are initialized the
                    first time control passes through that
                    function. This is not precise enough to pin down an