1// RUN: %check_clang_tidy %s android-cloexec-inotify-init %t
2
3extern "C" int inotify_init();
4
5void f() {
6 inotify_init();
7 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer inotify_init() to inotify_init1() because inotify_init1() allows IN_CLOEXEC [android-cloexec-inotify-init]
8 // CHECK-FIXES: inotify_init1(IN_CLOEXEC);
9}
10
11namespace i {
12int inotify_init();
13void g() {
14 inotify_init();
15}
16} // namespace i
17
18class C {
19public:
20 int inotify_init();
21 void h() {
22 inotify_init();
23 }
24};
25

source code of clang-tools-extra/test/clang-tidy/checkers/android/cloexec-inotify-init.cpp