diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-27 08:13:45 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-27 08:13:45 +0000 |
commit | 591970b4bb30fdf92a458188588a82abebf02225 (patch) | |
tree | 8a5af59a4c3bbf800b96c9c554c9a84993e91a97 /gcc/c | |
parent | f648448de42beffd47d101f659adce6403ecf646 (diff) | |
download | gcc-591970b4bb30fdf92a458188588a82abebf02225.tar.gz |
PR c/64766
* c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
of FUNCTION_DECLs with error_mark_node.
* gcc.dg/pr64766.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220152 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index f361e7cb77f..408fc163ab7 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2015-01-27 Jakub Jelinek <jakub@redhat.com> + + PR c/64766 + * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL + of FUNCTION_DECLs with error_mark_node. + 2015-01-26 Jakub Jelinek <jakub@redhat.com> PR c/64778 diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 09b1bdf3893..aa74968d28b 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -6422,7 +6422,8 @@ store_init_value (location_t init_loc, tree decl, tree init, tree origtype) warning (OPT_Wtraditional, "traditional C rejects automatic " "aggregate initialization"); - DECL_INITIAL (decl) = value; + if (value != error_mark_node || TREE_CODE (decl) != FUNCTION_DECL) + DECL_INITIAL (decl) = value; /* ANSI wants warnings about out-of-range constant initializers. */ STRIP_TYPE_NOPS (value); |