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
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 "
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}}
14 // Don't warn about functions in anonymous namespaces.
16 // Even if they're in nested namespaces within an anonymous namespace.
23 // Don't warn about member functions.
27 // Don't warn about inline functions.
30 // Don't warn about function templates.
31 template<typename
> void h() { }
33 // Don't warn when instantiating function templates.
34 template void h
<int>();
36 // PR9519: don't warn about friend functions.
38 friend void I_friend() {}
41 // Don't warn on explicitly deleted functions.
44 extern void k() {} // expected-warning {{no previous prototype for function 'k'}}
45 // expected-note@-1{{declare 'static' if the function is not intended to be used outside of this translation unit}}
46 // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-2]]:{{.*}}-[[@LINE-2]]:{{.*}}}:"{{.*}}"
52 // No warning because this has internal linkage despite not being declared
53 // explicitly 'static', owing to the internal linkage parameter.
57 void *operator new(decltype(sizeof(3)) size
, const anon
&) throw() {