diff options
author | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-13 15:59:03 +0000 |
---|---|---|
committer | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-13 15:59:03 +0000 |
commit | b7d1b569577509f4a733da7949c899c936db453b (patch) | |
tree | e0e884867515d0a183ff624faa1b1cb6826bbf92 /gcc/c-typeck.c | |
parent | 2866115740e51f72fa50647b07f9ec10c9491d5f (diff) | |
download | gcc-b7d1b569577509f4a733da7949c899c936db453b.tar.gz |
../svn-commit.tmp
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r-- | gcc/c-typeck.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 89bfed1db64..2534c25e75d 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4719,12 +4719,14 @@ digest_init (tree type, tree init, bool strict_string, int require_constant) conversion. */ inside_init = convert (type, inside_init); - if (require_constant && !flag_isoc99 + if (require_constant + && (code == VECTOR_TYPE || !flag_isoc99) && TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR) { /* As an extension, allow initializing objects with static storage duration with compound literals (which are then treated just as - the brace enclosed list they contain). */ + the brace enclosed list they contain). Also allow this for + vectors, as we can only assign them with compound literals. */ tree decl = COMPOUND_LITERAL_EXPR_DECL (inside_init); inside_init = DECL_INITIAL (decl); } |