blob: f7e8db38a4f699b9649aa81365a209e98b78b444 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wmissing-prototypes %s
Anders Carlsson9f89dd72009-12-09 03:30:09 +00002
3void f() { } // expected-warning {{no previous prototype for function 'f'}}
4
5namespace NS {
6 void f() { } // expected-warning {{no previous prototype for function 'f'}}
7}
8
9namespace {
Anders Carlsson63fb6732009-12-09 03:44:46 +000010 // Don't warn about functions in anonymous namespaces.
Anders Carlsson9f89dd72009-12-09 03:30:09 +000011 void f() { }
12}
13
14struct A {
Anders Carlsson63fb6732009-12-09 03:44:46 +000015 // Don't warn about member functions.
Anders Carlsson9f89dd72009-12-09 03:30:09 +000016 void f() { }
17};
18
Anders Carlsson63fb6732009-12-09 03:44:46 +000019// Don't warn about inline functions.
20inline void g() { }
21
22// Don't warn about function templates.
23template<typename> void h() { }
24
25// Don't warn when instantiating function templates.
26template void h<int>();
John McCall850d3b32011-03-22 07:16:37 +000027
28// PR9519: don't warn about friend functions.
29class I {
30 friend void I_friend() {}
31};
32