2009-03-24 10:24:46 +08:00
|
|
|
// RUN: clang-cc -fsyntax-only -verify %s
|
2009-02-18 14:34:51 +08:00
|
|
|
|
|
|
|
int &foo(int);
|
|
|
|
double &foo(double);
|
2009-02-19 05:56:37 +08:00
|
|
|
void foo(...) __attribute__((__unavailable__)); // expected-note {{candidate function}} \
|
|
|
|
// expected-note{{function has been explicitly marked unavailable here}}
|
|
|
|
|
|
|
|
void bar(...) __attribute__((__unavailable__)); // expected-note 2{{explicitly marked unavailable}}
|
2009-02-18 14:34:51 +08:00
|
|
|
|
|
|
|
void test_foo(short* sp) {
|
|
|
|
int &ir = foo(1);
|
|
|
|
double &dr = foo(1.0);
|
2009-02-19 05:56:37 +08:00
|
|
|
foo(sp); // expected-error{{call to unavailable function 'foo'}}
|
|
|
|
|
|
|
|
void (*fp)(...) = &bar; // expected-warning{{'bar' is unavailable}}
|
|
|
|
void (*fp2)(...) = bar; // expected-warning{{'bar' is unavailable}}
|
|
|
|
|
|
|
|
int &(*fp3)(int) = foo;
|
|
|
|
void (*fp4)(...) = foo; // expected-warning{{'foo' is unavailable}}
|
2009-02-18 14:34:51 +08:00
|
|
|
}
|