"Fossies" - the Fresh Open Source Software Archive

Member "cfe-9.0.0.src/test/Sema/attr-cx2.c" (14 May 2019, 994 Bytes) of package /linux/misc/cfe-9.0.0.src.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "attr-cx2.c": 8.0.1_vs_9.0.0.

    1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c2x %s
    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 }