1 // RUN: %clang_cc1 -fsyntax-only -triple i686-pc-win32 -verify -std=c++11 %s 2 // PR14993 3 4 namespace test1 { 5 inline void f(); // expected-warning{{inline function 'test1::f' is not defined}} test()6 void test() { f(); } // expected-note{{used here}} 7 } 8 9 namespace test2 { 10 inline int f(); test()11 void test() { (void)sizeof(f()); } 12 } 13 14 namespace test3 { 15 void f(); // expected-warning{{inline function 'test3::f' is not defined}} 16 inline void f(); test()17 void test() { f(); } // expected-note{{used here}} 18 } 19 20 namespace test4 { 21 inline void error_on_zero(int); // expected-warning{{inline function 'test4::error_on_zero' is not defined}} error_on_zero(char *)22 inline void error_on_zero(char*) {} test()23 void test() { error_on_zero(0); } // expected-note{{used here}} 24 } 25 26 namespace test5 { 27 struct X { void f(); }; test(X & x)28 void test(X &x) { x.f(); } 29 } 30 31 namespace test6 { 32 struct X { inline void f(); }; // expected-warning{{inline function 'test6::X::f' is not defined}} test(X & x)33 void test(X &x) { x.f(); } // expected-note{{used here}} 34 } 35 36 namespace test7 { 37 void f(); // expected-warning{{inline function 'test7::f' is not defined}} test()38 void test() { f(); } // no used-here note. 39 inline void f(); 40 } 41 42 namespace test8 { 43 inline void foo() __attribute__((gnu_inline)); test()44 void test() { foo(); } 45 } 46 47 namespace test9 { 48 void foo(); test()49 void test() { foo(); } 50 inline void foo() __attribute__((gnu_inline)); 51 } 52 53 namespace test10 { 54 inline void foo(); test()55 void test() { foo(); } 56 inline void foo() __attribute__((gnu_inline)); 57 } 58 59 namespace test11 { 60 inline void foo() __attribute__((dllexport)); 61 inline void bar() __attribute__((dllimport)); test()62 void test() { foo(); bar(); } 63 } 64 65 namespace test12 { 66 template<typename> constexpr int _S_chk(int *); 67 decltype(_S_chk<int>(nullptr)) n; 68 } 69