|
5 | 5 | #include "func.h" |
6 | 6 |
|
7 | 7 | void func() {} |
8 | | -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func' |
| 8 | +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func' can be made static or moved into an anonymous namespace to enforce internal linkage |
9 | 9 | // CHECK-FIXES: static void func() {} |
10 | 10 |
|
11 | 11 | template<class T> |
12 | 12 | void func_template() {} |
13 | | -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_template' |
| 13 | +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_template' can be made static or moved into an anonymous namespace to enforce internal linkage |
14 | 14 | // CHECK-FIXES: static void func_template() {} |
15 | 15 |
|
16 | 16 | void func_cpp_inc() {} |
17 | | -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_cpp_inc' |
| 17 | +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_cpp_inc' can be made static or moved into an anonymous namespace to enforce internal linkage |
18 | 18 | // CHECK-FIXES: static void func_cpp_inc() {} |
19 | 19 |
|
20 | 20 | int* func_cpp_inc_return_ptr() { return nullptr; } |
21 | | -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_cpp_inc_return_ptr' |
| 21 | +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_cpp_inc_return_ptr' can be made static or moved into an anonymous namespace to enforce internal linkage |
22 | 22 | // CHECK-FIXES: static int* func_cpp_inc_return_ptr() { return nullptr; } |
23 | 23 |
|
24 | 24 | const int* func_cpp_inc_return_const_ptr() { return nullptr; } |
25 | | -// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: function 'func_cpp_inc_return_const_ptr' |
| 25 | +// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: function 'func_cpp_inc_return_const_ptr' can be made static or moved into an anonymous namespace to enforce internal linkage |
26 | 26 | // CHECK-FIXES: static const int* func_cpp_inc_return_const_ptr() { return nullptr; } |
27 | 27 |
|
28 | 28 | int const* func_cpp_inc_return_ptr_const() { return nullptr; } |
29 | | -// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: function 'func_cpp_inc_return_ptr_const' |
| 29 | +// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: function 'func_cpp_inc_return_ptr_const' can be made static or moved into an anonymous namespace to enforce internal linkage |
30 | 30 | // CHECK-FIXES: static int const* func_cpp_inc_return_ptr_const() { return nullptr; } |
31 | 31 |
|
32 | 32 | int * const func_cpp_inc_return_const() { return nullptr; } |
33 | | -// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: function 'func_cpp_inc_return_const' |
| 33 | +// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: function 'func_cpp_inc_return_const' can be made static or moved into an anonymous namespace to enforce internal linkage |
34 | 34 | // CHECK-FIXES: static int * const func_cpp_inc_return_const() { return nullptr; } |
35 | 35 |
|
36 | 36 | volatile const int* func_cpp_inc_return_volatile_const_ptr() { return nullptr; } |
37 | | -// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: function 'func_cpp_inc_return_volatile_const_ptr' |
| 37 | +// CHECK-MESSAGES: :[[@LINE-1]]:21: warning: function 'func_cpp_inc_return_volatile_const_ptr' can be made static or moved into an anonymous namespace to enforce internal linkage |
38 | 38 | // CHECK-FIXES: static volatile const int* func_cpp_inc_return_volatile_const_ptr() { return nullptr; } |
39 | 39 |
|
40 | 40 | [[nodiscard]] void func_nodiscard() {} |
41 | | -// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: function 'func_nodiscard' |
| 41 | +// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: function 'func_nodiscard' can be made static or moved into an anonymous namespace to enforce internal linkage |
42 | 42 | // CHECK-FIXES: {{\[\[nodiscard\]\]}} static void func_nodiscard() {} |
43 | 43 |
|
44 | 44 | #define NDS [[nodiscard]] |
45 | 45 | #define NNDS |
46 | 46 |
|
47 | 47 | NDS void func_nds() {} |
48 | | -// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: function 'func_nds' |
| 48 | +// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: function 'func_nds' can be made static or moved into an anonymous namespace to enforce internal linkage |
49 | 49 | // CHECK-FIXES: NDS static void func_nds() {} |
50 | 50 |
|
51 | 51 | NNDS void func_nnds() {} |
52 | | -// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: function 'func_nnds' |
| 52 | +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: function 'func_nnds' can be made static or moved into an anonymous namespace to enforce internal linkage |
53 | 53 | // CHECK-FIXES: NNDS static void func_nnds() {} |
54 | 54 |
|
55 | 55 | #include "func_cpp.inc" |
@@ -78,7 +78,7 @@ extern "C" void func_extern_c_2() {} |
78 | 78 |
|
79 | 79 | namespace gh117488 { |
80 | 80 | void func_with_body(); |
81 | | -// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_with_body' |
| 81 | +// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'func_with_body' can be made static or moved into an anonymous namespace to enforce internal linkage |
82 | 82 | // CHECK-FIXES: static void func_with_body(); |
83 | 83 | void func_with_body() {} |
84 | 84 |
|
|
0 commit comments