diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-01-01 19:40:03 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-01-01 19:40:03 +0000 |
commit | d241bf0d8c67ab7ab3c1963303d9515dbe944c11 (patch) | |
tree | 53fbcd06f068c1f286ce731e58bc68cc5c3d092f /gcc/c-parser.c | |
parent | f12ce4403edfb51034c4b4c7dc1b9fc723159a32 (diff) | |
download | gcc-d241bf0d8c67ab7ab3c1963303d9515dbe944c11.tar.gz |
PR c/36489
* c-typeck.c (add_pending_init): Add IMPLICIT argument. Only
warn about overwriting initializer with side-effects or
-Woverride-init if !IMPLICIT.
(output_init_element): Likewise. Pass IMPLICIT down to
add_pending_init.
(process_init_element): Add IMPLICIT argument. Pass it down
to output_init_element.
(push_init_element, pop_init_level, set_designator): Adjust
process_init_element callers.
(set_nonincremental_init, set_nonincremental_init_from_string):
Adjust add_pending_init callers.
(output_pending_init_elements): Adjust output_init_element callers.
* c-tree.h (process_init_element): Adjust prototype.
* c-parser.c (c_parser_initelt, c_parser_initval): Adjust
process_init_element callers.
* gcc.dg/pr36489.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142998 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 8c4a96fdee6..99c6c187a1e 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -1,6 +1,6 @@ /* Parser for C and Objective-C. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. Parser actions based on the old Bison parser; structure somewhat @@ -3090,7 +3090,7 @@ c_parser_initelt (c_parser *parser) init.original_code = ERROR_MARK; c_parser_error (parser, "expected identifier"); c_parser_skip_until_found (parser, CPP_COMMA, NULL); - process_init_element (init); + process_init_element (init, false); return; } } @@ -3213,7 +3213,7 @@ c_parser_initelt (c_parser *parser) init.original_code = ERROR_MARK; c_parser_error (parser, "expected %<=%>"); c_parser_skip_until_found (parser, CPP_COMMA, NULL); - process_init_element (init); + process_init_element (init, false); return; } } @@ -3243,7 +3243,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after) && TREE_CODE (init.value) != COMPOUND_LITERAL_EXPR) init = default_function_array_conversion (init); } - process_init_element (init); + process_init_element (init, false); } /* Parse a compound statement (possibly a function body) (C90 6.6.2, |