aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-decl.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr69819.c5
4 files changed, 17 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index d0fbaba..f814833 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 8e332f8..298036a 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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 311232f..4ba14fc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-24 Marek Polacek <polacek@redhat.com>
+
+ PR c/69819
+ * gcc.dg/pr69819.c: New test.
+
2016-02-24 Martin Sebor <msebor@redhat.com>
PR c++/69912
diff --git a/gcc/testsuite/gcc.dg/pr69819.c b/gcc/testsuite/gcc.dg/pr69819.c
new file mode 100644
index 0000000..a9594dd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69819.c
@@ -0,0 +1,5 @@
+/* PR c/69819 */
+/* { dg-do compile } */
+
+void foo () { }
+int foo[] = { 0 }; /* { dg-error ".foo. redeclared as different kind of symbol" } */