blob: 4d07a238a9c4233f31475e5929d067e7084e04fe [file] [log] [blame]
Fariborz Jahanianc784dc12010-10-06 23:12:32 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2// rdar: //6734520
3
4int foo(int) __attribute__((__unavailable__("USE IFOO INSTEAD"))); // expected-note {{function has been explicitly marked unavailable here}}
5double dfoo(double) __attribute__((__unavailable__("NO LONGER"))); // expected-note 2 {{function has been explicitly marked unavailable here}}
6
7void bar() __attribute__((__unavailable__)); // expected-note {{explicitly marked unavailable}}
8
9void test_foo() {
10 int ir = foo(1); // expected-error {{'foo' is unavailable: USE IFOO INSTEAD}}
11 double dr = dfoo(1.0); // expected-error {{'dfoo' is unavailable: NO LONGER}}
12
13 void (*fp)() = &bar; // expected-error {{'bar' is unavailable}}
14
15 double (*fp4)(double) = dfoo; // expected-error {{'dfoo' is unavailable: NO LONGER}}
16}