1f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -verify -fsyntax-only 2f4a2713aSLionel Sambuc // rdar: // 6734520 3f4a2713aSLionel Sambuc 4*0a6a1f1dSLionel Sambuc typedef int INT1 __attribute__((deprecated("Please avoid INT1"))); // expected-note 3 {{'INT1' has been explicitly marked deprecated here}} 5f4a2713aSLionel Sambuc 6f4a2713aSLionel Sambuc typedef INT1 INT2 __attribute__ ((__deprecated__("Please avoid INT2"))); 7f4a2713aSLionel Sambuc 8f4a2713aSLionel Sambuc typedef INT1 INT1a; // expected-warning {{'INT1' is deprecated: Please avoid INT1}} 9f4a2713aSLionel Sambuc 10f4a2713aSLionel Sambuc typedef INT1 INT1b __attribute__ ((deprecated("Please avoid INT1b"))); 11f4a2713aSLionel Sambuc 12f4a2713aSLionel Sambuc INT1 should_be_unavailable; // expected-warning {{'INT1' is deprecated: Please avoid INT1}} 13f4a2713aSLionel Sambuc INT1a should_not_be_deprecated; 14f4a2713aSLionel Sambuc 15*0a6a1f1dSLionel Sambuc INT1 f1(void) __attribute__ ((deprecated("Please avoid f1"))); // expected-note {{'f1' has been explicitly marked deprecated here}} 16f4a2713aSLionel Sambuc INT1 f2(void); // expected-warning {{'INT1' is deprecated: Please avoid INT1}} 17f4a2713aSLionel Sambuc 18*0a6a1f1dSLionel Sambuc typedef enum {red, green, blue} Color __attribute__((deprecated("Please avoid Color"))); // expected-note {{'Color' has been explicitly marked deprecated here}} 19f4a2713aSLionel Sambuc 20f4a2713aSLionel Sambuc 21f4a2713aSLionel Sambuc Color c1; // expected-warning {{'Color' is deprecated: Please avoid Color}} 22f4a2713aSLionel Sambuc 23f4a2713aSLionel Sambuc int g1; 24*0a6a1f1dSLionel Sambuc int g2 __attribute__ ((deprecated("Please avoid g2"))); // expected-note {{'g2' has been explicitly marked deprecated here}} 25f4a2713aSLionel Sambuc func1()26f4a2713aSLionel Sambucint func1() 27f4a2713aSLionel Sambuc { 28f4a2713aSLionel Sambuc int (*pf)() = f1; // expected-warning {{'f1' is deprecated: Please avoid f1}} 29f4a2713aSLionel Sambuc int i = f2(); 30f4a2713aSLionel Sambuc return g1 + g2; // expected-warning {{'g2' is deprecated: Please avoid g2}} 31f4a2713aSLionel Sambuc } 32