llvm-for-llvmta/tools/clang/test/SemaObjCXX/attr-swift_name-cxx.mm

14 lines
536 B
Plaintext
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_cc1 -verify -fsyntax-only -fobjc-arc -fblocks %s
#define SWIFT_ASYNC_NAME(name) __attribute__((__swift_async_name__(name)))
typedef int (^CallbackTy)(void);
class CXXClass {
public:
virtual void doSomethingWithCallback(CallbackTy callback) SWIFT_ASYNC_NAME("doSomething()");
// expected-warning@+1 {{too few parameters in the signature specified by the '__swift_async_name__' attribute (expected 1; got 0)}}
virtual void doSomethingWithCallback(int x, CallbackTy callback) SWIFT_ASYNC_NAME("doSomething()");
};