+2020-01-15 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/93072
+ * c-decl.c (pushdecl): Use TREE_PUBLIC, not DECL_EXTERNAL, to
+ determine whether to set DECL_CONTEXT.
+
2020-01-13 Joseph Myers <joseph@codesourcery.com>
PR c/93241
unless they have initializers (which generate code). */
if (current_function_decl
&& (!VAR_OR_FUNCTION_DECL_P (x)
- || DECL_INITIAL (x) || !DECL_EXTERNAL (x)))
+ || DECL_INITIAL (x) || !TREE_PUBLIC (x)))
DECL_CONTEXT (x) = current_function_decl;
/* Anonymous decls are just inserted in the scope. */
+2020-01-15 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/93072
+ * gcc.dg/inline-42.c, gcc.dg/inline-43.c: New tests.
+
2020-01-14 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/analyzer/signal-6.c: New test.
--- /dev/null
+/* Test inline functions declared in inner scopes. Bug 93072. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+inline_1 (void)
+{
+}
+
+void
+inline_2 (void)
+{
+}
+
+static void
+inline_static_1 (void)
+{
+}
+
+static void
+inline_static_2 (void)
+{
+}
+
+static void
+test (void)
+{
+ inline void inline_1 (void);
+ if (inline_1 == 0) ;
+ extern inline void inline_2 (void);
+ if (inline_2 == 0) ;
+ inline void inline_3 (void);
+ if (inline_3 == 0) ;
+ extern inline void inline_4 (void);
+ if (inline_4 == 0) ;
+ inline void inline_static_1 (void);
+ if (inline_static_1 == 0) ;
+ extern inline void inline_static_2 (void);
+ if (inline_static_2 == 0) ;
+}
+
+void
+inline_3 (void)
+{
+}
+
+void
+inline_4 (void)
+{
+}
--- /dev/null
+/* Test inline functions declared in inner scopes. Bug 93072. */
+/* { dg-do compile } */
+/* { dg-options "-fgnu89-inline" } */
+
+void
+inline_1 (void)
+{
+}
+
+void
+inline_2 (void)
+{
+}
+
+static void
+inline_static_1 (void)
+{
+}
+
+static void
+inline_static_2 (void)
+{
+}
+
+static void
+test (void)
+{
+ inline void inline_1 (void);
+ if (inline_1 == 0) ;
+ extern inline void inline_2 (void);
+ if (inline_2 == 0) ;
+ inline void inline_3 (void);
+ if (inline_3 == 0) ;
+ extern inline void inline_4 (void);
+ if (inline_4 == 0) ;
+ inline void inline_static_1 (void);
+ if (inline_static_1 == 0) ;
+ extern inline void inline_static_2 (void);
+ if (inline_static_2 == 0) ;
+}
+
+void
+inline_3 (void)
+{
+}
+
+void
+inline_4 (void)
+{
+}