PR c/89045
* c-decl.c (build_compound_literal): Don't pushdecl if in parameter
scope.
* gcc.dg/pr89045.c: New test.
From-SVN: r268349
2019-01-29 Jakub Jelinek <jakub@redhat.com>
+ PR c/89045
+ * c-decl.c (build_compound_literal): Don't pushdecl if in parameter
+ scope.
+
PR c/86125
* c-decl.c (last_fileptr_type): Remove.
(last_structptr_types): New variable.
pushdecl (decl);
rest_of_decl_compilation (decl, 1, 0);
}
- else if (current_function_decl)
+ else if (current_function_decl && !current_scope->parm_flag)
pushdecl (decl);
if (non_const)
2019-01-29 Jakub Jelinek <jakub@redhat.com>
+ PR c/89045
+ * gcc.dg/pr89045.c: New test.
+
PR c/86125
* gcc.dg/Wbuiltin-declaration-mismatch-7.c: Guard testcase for
lp64, ilp32 and llp64 only.
--- /dev/null
+/* PR c/89045 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int
+foo (int x)
+{
+ int v[(int){ x }];
+ v[0] = 0;
+ int bar (int p[(int){ x }])
+ {
+ return p[0];
+ }
+ return bar (v);
+}