// RUN: %clang_cc1 -triple i386-pc-unknown -fsyntax-only -Wstrict-prototypes -Wno-implicit-function-declaration -Wno-error=implicit-int -verify %s
// RUN: %clang_cc1 -triple i386-pc-unknown -fsyntax-only -Wstrict-prototypes -Wno-implicit-function-declaration -Wno-error=implicit-int -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
// function definition with 0 params, no prototype, no preceding declaration.
void // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
// function declaration with unspecified params
void ; // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:11}:"void"
// function declaration with 0 params
void ;
// function definition with 0 params, no prototype.
void // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
// function definition with 0 params, prototype.
void
// function type typedef unspecified params
typedef void ; // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:19-[[@LINE-1]]:19}:"void"
// global fp unspecified params
; // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:14-[[@LINE-1]]:14}:"void"
// struct member fp unspecified params
s; // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:23-[[@LINE-1]]:23}:"void"
// param fp unspecified params
void
// function type cast using using an anonymous function declaration
void
// K&R function definition not preceded by full prototype
int int a, b;
// Function declaration with no types
void ; // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}} \
expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:12-[[@LINE-2]]:12}:"void"
// K&R function definition with incomplete param list declared
void void *p; // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}} \
expected-warning {{parameter 'p2' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}}
void ;
void int p; int p2; // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
// PR31020
void short d;
// No warnings for variadic functions. Overloadable attribute is required
// to avoid err_ellipsis_first_param error.
// rdar://problem/33251668
void ;
void
// We should not generate a strict-prototype warning for an implicit
// declaration. Leave that up to the implicit-function-declaration warning.
void
// Ensure that redeclarations involving a typedef type work properly, even if
// there are function attributes involved in the declaration.
typedef void ;
foo_t foo15;
foo_t foo15; // OK
void ; // OK
foo_t foo16;
void ; // OK