From 566f381ce126fad247de3b99a4cc231c00bf9fe5 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 9 Apr 1999 12:43:24 +0000 Subject: * c-common.c (decl_attributes, A_INIT_PRIORITY): Allow arrays of classes, too. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26312 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/c-common.c') diff --git a/gcc/c-common.c b/gcc/c-common.c index 8ea14899a25..18fc72934a3 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -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 -- cgit v1.2.1