diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-24 21:47:59 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-02-24 21:47:59 +0000 |
commit | f0ea75d154a38860e4fb59f84f6cc87fdf1de578 (patch) | |
tree | 129d48f696abba50424da8117a9d088ef3d1c3af /gcc/c | |
parent | 2b80a2a83a6203b52b7c5e30885f17c8bfd9757f (diff) | |
download | gcc-f0ea75d154a38860e4fb59f84f6cc87fdf1de578.tar.gz |
PR c/69819
* c-decl.c (finish_decl): Don't update the copy of the type of a
different decl type.
* gcc.dg/pr69819.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233683 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index d0fbaba96ba..f814833538b 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2016-02-24 Marek Polacek <polacek@redhat.com> + + PR c/69819 + * c-decl.c (finish_decl): Don't update the copy of the type of a + different decl type. + 2016-02-23 Jakub Jelinek <jakub@redhat.com> PR objc/69844 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 8e332f8c061..298036a4eec 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -4743,7 +4743,7 @@ finish_decl (tree decl, location_t init_loc, tree init, struct c_binding *b_ext = I_SYMBOL_BINDING (DECL_NAME (decl)); while (b_ext && !B_IN_EXTERNAL_SCOPE (b_ext)) b_ext = b_ext->shadowed; - if (b_ext) + if (b_ext && TREE_CODE (decl) == TREE_CODE (b_ext->decl)) { if (b_ext->u.type && comptypes (b_ext->u.type, type)) b_ext->u.type = composite_type (b_ext->u.type, type); |