// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wmissing-prototypes -Wno-deprecated-non-prototype -verify %s
// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wmissing-prototypes -Wno-deprecated-non-prototype -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
int ; // expected-note{{this declaration is not a prototype; add parameter declarations to make it one}}
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:{{.*}}-[[@LINE-1]]:{{.*}}}:"{{.*}}"
int // expected-warning{{no previous prototype for function 'f'}}
static int
int // expected-warning{{no previous prototype for function 'h'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:1-[[@LINE-2]]:1}:"static "
static int ;
int
extern int // expected-warning{{no previous prototype for function 'g3'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:{{.*}}-[[@LINE-2]]:{{.*}}}:"{{.*}}"
void ;
int ; // expected-note{{this declaration is not a prototype; add parameter declarations to make it one}}
// CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:{{.*}}-[[@LINE-1]]:{{.*}}}:"{{.*}}"
int ;
int ;
void
int // expected-warning{{no previous prototype for function 'h2'}}
// expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
int // expected-warning{{no previous prototype for function 'h3'}}
int
int ;
int ;
int
// rdar://6759522
int
void ; // expected-note{{this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:27-[[@LINE-1]]:27}:"void"
void // expected-warning{{no previous prototype for function 'not_a_prototype_test'}}
const int *
;
const struct MyStruct
// Turn off clang-format for white-space dependent testing.
// clang-format off
// Two spaces between cost and struct
const struct MyStruct
// Two spaces bewteen const and struct
const struct MyStruct*
// Random comment before const.
/*some randome comment*/const struct MyStruct*
// Random comment after const.
const/*some randome comment*/ struct MyStruct*
// clang-format on
// Since we can't easily understand what MY_CONST means while preparing the
// diagnostic, the fix-it suggests to add 'static' in a non-idiomatic place.
MY_CONST struct MyStruct *