1 // RUN: %clang_cc1 %s -verify -fsyntax-only
3 // expected-no-diagnostics
6 #include "../Sema/attr-callback.c"
11 void no_args_1(void (*callback
)(void));
12 __attribute__((callback(1))) void no_args_2(void (*callback
)(void));
13 __attribute__((callback(callback
))) void no_args_3(void (*callback
)(void)) {}
15 __attribute__((callback(1, 0))) virtual void
16 this_tr(void (*callback
)(Base
*));
18 __attribute__((callback(1, this, __
, this))) virtual void
19 this_unknown_this(void (*callback
)(Base
*, Base
*, Base
*));
21 __attribute__((callback(1))) virtual void
22 virtual_1(void (*callback
)(void));
24 __attribute__((callback(callback
))) virtual void
25 virtual_2(void (*callback
)(void));
27 __attribute__((callback(1))) virtual void
28 virtual_3(void (*callback
)(void));
31 __attribute__((callback(1))) void
32 Base::no_args_1(void (*callback
)(void)) {
35 void Base::no_args_2(void (*callback
)(void)) {
38 struct Derived_1
: public Base
{
40 __attribute__((callback(1, 0))) virtual void
41 this_tr(void (*callback
)(Base
*)) override
;
43 __attribute__((callback(1))) virtual void
44 virtual_1(void (*callback
)(void)) override
{}
47 virtual_3(void (*callback
)(void)) override
{}
50 struct Derived_2
: public Base
{
52 __attribute__((callback(callback
))) virtual void
53 virtual_1(void (*callback
)(void)) override
;
56 virtual_2(void (*callback
)(void)) override
;
59 virtual_3(void (*callback
)(void)) override
;
62 void Derived_2::virtual_1(void (*callback
)(void)) {}
64 __attribute__((callback(1))) void
65 Derived_2::virtual_2(void (*callback
)(void)) {}
67 void Derived_2::virtual_3(void (*callback
)(void)) {}