1 // RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-prototypes -std=c++11 %s
2 // RUN: %clang_cc1 -fsyntax-only -Wmissing-prototypes -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
3
f()4 void f() { } // expected-warning {{no previous prototype for function 'f'}}
5 // expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
6 // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:1-[[@LINE-2]]:1}:"static "
7
8 namespace NS {
f()9 void f() { } // expected-warning {{no previous prototype for function 'f'}}
10 // expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
11 }
12
13 namespace {
14 // Don't warn about functions in anonymous namespaces.
f()15 void f() { }
16 }
17
18 struct A {
19 // Don't warn about member functions.
fA20 void f() { }
21 };
22
23 // Don't warn about inline functions.
g()24 inline void g() { }
25
26 // Don't warn about function templates.
h()27 template<typename> void h() { }
28
29 // Don't warn when instantiating function templates.
30 template void h<int>();
31
32 // PR9519: don't warn about friend functions.
33 class I {
I_friend()34 friend void I_friend() {}
35 };
36
37 // Don't warn on explicitly deleted functions.
38 void j() = delete;
39
k()40 extern void k() {} // expected-warning {{no previous prototype for function 'k'}}
41 // expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
42 // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:{{.*}}-[[@LINE-2]]:{{.*}}}:"{{.*}}"
43