blob: 8e5f76bcacfa73a2e72284b242689f829c4e911c [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Douglas Gregorc6666f82009-02-18 06:34:51 +00002
3int &foo(int);
4double &foo(double);
Douglas Gregor48f3bb92009-02-18 21:56:37 +00005void foo(...) __attribute__((__unavailable__)); // expected-note {{candidate function}} \
6// expected-note{{function has been explicitly marked unavailable here}}
7
8void bar(...) __attribute__((__unavailable__)); // expected-note 2{{explicitly marked unavailable}}
Douglas Gregorc6666f82009-02-18 06:34:51 +00009
10void test_foo(short* sp) {
11 int &ir = foo(1);
12 double &dr = foo(1.0);
Douglas Gregor48f3bb92009-02-18 21:56:37 +000013 foo(sp); // expected-error{{call to unavailable function 'foo'}}
14
15 void (*fp)(...) = &bar; // expected-warning{{'bar' is unavailable}}
16 void (*fp2)(...) = bar; // expected-warning{{'bar' is unavailable}}
17
18 int &(*fp3)(int) = foo;
19 void (*fp4)(...) = foo; // expected-warning{{'foo' is unavailable}}
Douglas Gregorc6666f82009-02-18 06:34:51 +000020}