2008-03-03 11:28:21 +08:00
|
|
|
// RUN: clang %s -verify -fsyntax-only
|
|
|
|
|
|
|
|
int f() __attribute__((deprecated));
|
|
|
|
void g() __attribute__((deprecated));
|
|
|
|
void g();
|
|
|
|
|
2009-02-13 16:22:04 +08:00
|
|
|
void z() __attribute__((bogusattr)); // expected-warning {{'bogusattr' attribute ignored}}
|
2008-03-03 11:28:21 +08:00
|
|
|
|
|
|
|
extern int var __attribute__((deprecated));
|
|
|
|
|
|
|
|
int a() {
|
|
|
|
int (*ptr)() = f; // expected-warning {{'f' is deprecated}}
|
|
|
|
f(); // expected-warning {{'f' is deprecated}}
|
|
|
|
|
|
|
|
// test if attributes propagate to functions
|
|
|
|
g(); // expected-warning {{'g' is deprecated}}
|
|
|
|
|
|
|
|
return var; // expected-warning {{'var' is deprecated}}
|
|
|
|
}
|
|
|
|
|
|
|
|
// test if attributes propagate to variables
|
|
|
|
extern int var;
|
|
|
|
int w() {
|
|
|
|
return var; // expected-warning {{'var' is deprecated}}
|
|
|
|
}
|