[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / clang / test / Sema / attr-mig.cpp
blob5dfc43bc1ec88c43da0702b2a2ae4f861696773b
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 typedef int kern_return_t;
4 typedef kern_return_t IOReturn;
5 #define KERN_SUCCESS 0
6 #define kIOReturnSuccess KERN_SUCCESS
8 class MyServer {
9 public:
10 virtual __attribute__((mig_server_routine)) IOReturn externalMethod();
11 virtual __attribute__((mig_server_routine)) void anotherMethod(); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}
12 virtual __attribute__((mig_server_routine)) int yetAnotherMethod(); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}
13 [[clang::mig_server_routine]] virtual IOReturn cppAnnotatedMethod();
14 [[clang::mig_server_routine("arg")]] virtual IOReturn cppAnnotatedMethodWithInvalidArgs(); // expected-error{{'mig_server_routine' attribute takes no arguments}}
15 [[clang::mig_server_routine]] virtual int cppInvalidAnnotatedMethod(); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}
18 IOReturn MyServer::externalMethod() {
19 return kIOReturnSuccess;