Aaron Ballman | d06f391 | 2019-05-14 12:09:55 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c2x %s |
Aaron Ballman | 4c4a983 | 2018-02-19 17:32:07 +0000 | [diff] [blame] | 2 | |
| 3 | struct S {}; |
| 4 | struct S * [[clang::address_space(1)]] Foo; |
| 5 | |
| 6 | enum [[clang::enum_extensibility(open)]] EnumOpen { |
| 7 | C0 = 1, C1 = 10 |
| 8 | }; |
| 9 | |
| 10 | enum [[clang::flag_enum]] EnumFlag { |
| 11 | D0 = 1, D1 = 8 |
| 12 | }; |
| 13 | |
| 14 | void foo(void *c) [[clang::overloadable]]; |
| 15 | void foo(char *c) [[clang::overloadable]]; |
| 16 | |
| 17 | void context_okay(void *context [[clang::swift_context]]) [[clang::swiftcall]]; |
| 18 | void context_okay2(void *context [[clang::swift_context]], void *selfType, char **selfWitnessTable) [[clang::swiftcall]]; |
| 19 | |
| 20 | void *f1(void) [[clang::ownership_returns(foo)]]; |
| 21 | void *f2() [[clang::ownership_returns(foo)]]; // expected-warning {{'ownership_returns' attribute only applies to non-K&R-style functions}} |
| 22 | |
| 23 | void foo2(void) [[clang::unavailable("not available - replaced")]]; // expected-note {{'foo2' has been explicitly marked unavailable here}} |
| 24 | void bar(void) { |
| 25 | foo2(); // expected-error {{'foo2' is unavailable: not available - replaced}} |
| 26 | } |