gcc/c/
PR c/120055
* c-typeck.cc (convert_arguments): Check if fundecl is null
before checking for builtin function declaration.
gcc/testsuite/
* gcc.dg/Wdeprecated-non-prototype-6.c: New test.
}
if (!typetail && parmnum == 0 && !TYPE_NO_NAMED_ARGS_STDARG_P (fntype)
- && !fndecl_built_in_p (fundecl))
+ && !(fundecl && fndecl_built_in_p (fundecl)))
{
auto_diagnostic_group d;
bool warned;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-std=gnu17 -Wdeprecated-non-prototype" } */
+
+void (*f1) ();
+void (*f2) ();
+void (*f3) (...);
+
+void
+g ()
+{
+ f1 ();
+ f2 (1); /* { dg-warning "does not allow arguments for function" } */
+ f3 (1);
+}