blob: 8b381dfe4b25b06cb67c59ce81092ad925457520 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregorc6666f82009-02-18 06:34:51 +00002
John McCall81201622010-01-08 04:41:39 +00003int &foo(int); // expected-note {{candidate}}
4double &foo(double); // expected-note {{candidate}}
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}