Add LLVM runtime checks to build path
[clang/acc.git] / test / SemaCXX / attr-unavailable.cpp
blob8e5f76bcacfa73a2e72284b242689f829c4e911c
1 // RUN: clang-cc -fsyntax-only -verify %s
3 int &foo(int);
4 double &foo(double);
5 void foo(...) __attribute__((__unavailable__)); // expected-note {{candidate function}} \
6 // expected-note{{function has been explicitly marked unavailable here}}
8 void bar(...) __attribute__((__unavailable__)); // expected-note 2{{explicitly marked unavailable}}
10 void test_foo(short* sp) {
11 int &ir = foo(1);
12 double &dr = foo(1.0);
13 foo(sp); // expected-error{{call to unavailable function 'foo'}}
15 void (*fp)(...) = &bar; // expected-warning{{'bar' is unavailable}}
16 void (*fp2)(...) = bar; // expected-warning{{'bar' is unavailable}}
18 int &(*fp3)(int) = foo;
19 void (*fp4)(...) = foo; // expected-warning{{'foo' is unavailable}}