Douglas Gregor | c6666f8 | 2009-02-18 06:34:51 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | int &foo(int); |
| 4 | double &foo(double); |
Douglas Gregor | 48f3bb9 | 2009-02-18 21:56:37 +0000 | [diff] [blame] | 5 | void foo(...) __attribute__((__unavailable__)); // expected-note {{candidate function}} \ |
| 6 | // expected-note{{function has been explicitly marked unavailable here}} |
| 7 | |
| 8 | void bar(...) __attribute__((__unavailable__)); // expected-note 2{{explicitly marked unavailable}} |
Douglas Gregor | c6666f8 | 2009-02-18 06:34:51 +0000 | [diff] [blame] | 9 | |
| 10 | void test_foo(short* sp) { |
| 11 | int &ir = foo(1); |
| 12 | double &dr = foo(1.0); |
Douglas Gregor | 48f3bb9 | 2009-02-18 21:56:37 +0000 | [diff] [blame] | 13 | 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 Gregor | c6666f8 | 2009-02-18 06:34:51 +0000 | [diff] [blame] | 20 | } |