Commit c4581bbf by Jakub Jelinek Committed by Jakub Jelinek

re PR c/88701 (Internal compiler error for valid program using compound literal…

re PR c/88701 (Internal compiler error for valid program using compound literal with variably modified type.)

	PR c/88701
	* c-decl.c (build_compound_literal): If not TREE_STATIC, only pushdecl
	if current_function_decl is non-NULL.

	* gcc.dg/pr88701.c: New test.

From-SVN: r267667
parent 2d8d93c7
2019-01-07 Jakub Jelinek <jakub@redhat.com>
PR c/88701
* c-decl.c (build_compound_literal): If not TREE_STATIC, only pushdecl
if current_function_decl is non-NULL.
2019-01-07 Joseph Myers <joseph@codesourcery.com>
PR c/88720
......
......@@ -5438,7 +5438,7 @@ build_compound_literal (location_t loc, tree type, tree init, bool non_const,
pushdecl (decl);
rest_of_decl_compilation (decl, 1, 0);
}
else
else if (current_function_decl)
pushdecl (decl);
if (non_const)
......
2019-01-07 Jakub Jelinek <jakub@redhat.com>
PR c/88701
* gcc.dg/pr88701.c: New test.
2019-01-07 Joseph Myers <joseph@codesourcery.com>
PR c/88720
......
/* PR c/88701 */
/* { dg-do compile } */
/* { dg-options "-std=c99 -pedantic-errors" } */
void foo (int [(int (*)[1]) { 0 } == 0]);
void bar (int n, int [(int (*)[n]) { 0 } == 0]);
int
baz (int a[(int (*)[1]) { 0 } == 0])
{
return a[0];
}
int
qux (int n, int a[(int (*)[n]) { 0 } == 0])
{
return a[0] + n;
}
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