Commit 0b05329b by Marek Polacek Committed by Marek Polacek

re PR c/69819 (ICE on invalid code on x86_64-linux-gnu in tree check: expected…

re PR c/69819 (ICE on invalid code on x86_64-linux-gnu in tree check: expected function_type or method_type, have array_type in function_args_iter_init, at tree.h:4536)

	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.

From-SVN: r233683
parent 944e9f5f
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
......
......@@ -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);
......
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
......
/* PR c/69819 */
/* { dg-do compile } */
void foo () { }
int foo[] = { 0 }; /* { dg-error ".foo. redeclared as different kind of symbol" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment