1// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wmissing-prototypes -verify %s
2// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wmissing-prototypes -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
3
4int f();
5
6int f(int x) { return x; } // expected-warning{{no previous prototype for function 'f'}}
7
8static int g(int x) { return x; }
9
10int h(int x) { return x; } // expected-warning{{no previous prototype for function 'h'}}
11
12static int g2();
13
14int g2(int x) { return x; }
15
16void test(void);
17
18int h3();
19int h4(int);
20int h4();
21
22void test(void) {
23  int h2(int x);
24  int h3(int x);
25  int h4();
26}
27
28int h2(int x) { return x; } // expected-warning{{no previous prototype for function 'h2'}}
29int h3(int x) { return x; } // expected-warning{{no previous prototype for function 'h3'}}
30int h4(int x) { return x; }
31
32int f2(int);
33int f2();
34
35int f2(int x) { return x; }
36
37// rdar://6759522
38int main(void) { return 0; }
39
40void not_a_prototype_test(); // expected-note{{this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function}}
41void not_a_prototype_test() { } // expected-warning{{no previous prototype for function 'not_a_prototype_test'}}
42
43// CHECK: fix-it:"{{.*}}":{40:27-40:27}:"void"
44