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

source code of clang-tools-extra/test/clang-tidy/checkers/android/cloexec-epoll-create.cpp