Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | c6666f8 | 2009-02-18 06:34:51 +0000 | [diff] [blame] | 2 | |
John McCall | 8120162 | 2010-01-08 04:41:39 +0000 | [diff] [blame] | 3 | int &foo(int); // expected-note {{candidate}} |
| 4 | double &foo(double); // expected-note {{candidate}} |
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 | |
Ted Kremenek | 042411c | 2010-07-21 20:43:11 +0000 | [diff] [blame] | 15 | void (*fp)(...) = &bar; // expected-error{{'bar' is unavailable}} |
| 16 | void (*fp2)(...) = bar; // expected-error{{'bar' is unavailable}} |
Douglas Gregor | 48f3bb9 | 2009-02-18 21:56:37 +0000 | [diff] [blame] | 17 | |
| 18 | int &(*fp3)(int) = foo; |
Ted Kremenek | 042411c | 2010-07-21 20:43:11 +0000 | [diff] [blame] | 19 | void (*fp4)(...) = foo; // expected-error{{'foo' is unavailable}} |
Douglas Gregor | c6666f8 | 2009-02-18 06:34:51 +0000 | [diff] [blame] | 20 | } |