+2019-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/89340
+ * c-decl.c (start_function): Clear TREE_PUBLIC on nested functions
+ before c_decl_attributes rather than after it.
+
2019-02-06 Jakub Jelinek <jakub@redhat.com>
PR c/89211
loc = DECL_SOURCE_LOCATION (decl1);
+ /* A nested function is not global. */
+ if (current_function_decl != NULL_TREE)
+ TREE_PUBLIC (decl1) = 0;
+
c_decl_attributes (&decl1, attributes, 0);
if (DECL_DECLARED_INLINE_P (decl1)
error_mark_node is replaced below (in pop_scope) with the BLOCK. */
DECL_INITIAL (decl1) = error_mark_node;
- /* A nested function is not global. */
- if (current_function_decl != NULL_TREE)
- TREE_PUBLIC (decl1) = 0;
-
/* If this definition isn't a prototype and we had a prototype declaration
before, copy the arg type info from that prototype. */
old_decl = lookup_name_in_scope (DECL_NAME (decl1), current_scope);
2019-02-15 Jakub Jelinek <jakub@redhat.com>
+ PR c/89340
+ * gcc.dg/pr89340.c: New test.
+ * gcc.dg/torture/pr57036-2.c (jpgDecode_convert): Expect a warning
+ that leaf attribute on nested function is useless.
+
PR other/89342
* gcc.dg/pr89342.c: New test.