1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
3 // This test checks that a deprecated attribute on an alias
4 // template triggers a warning diagnostic when it is used.
11 // expected-note@+2 7{{'UsingWithAttr' has been explicitly marked deprecated here}}
13 using UsingWithAttr
__attribute__((deprecated
)) = NoAttr
<T
>;
15 // expected-note@+1 {{'UsingInstWithAttr' has been explicitly marked deprecated here}}
16 using UsingInstWithAttr
__attribute__((deprecated
)) = NoAttr
<int>;
18 // expected-note@+1 {{'TDWithAttr' has been explicitly marked deprecated here}}
19 typedef NoAttr
<int> TDWithAttr
__attribute__((deprecated
));
21 // expected-warning@+1 {{'UsingWithAttr' is deprecated}}
22 typedef UsingWithAttr
<int> TDUsingWithAttr
;
24 typedef NoAttr
<int> TDNoAttr
;
26 // expected-note@+1 {{'UsingTDWithAttr' has been explicitly marked deprecated here}}
27 using UsingTDWithAttr
__attribute__((deprecated
)) = TDNoAttr
;
31 // expected-warning@+1 {{'UsingWithAttr' is deprecated}}
32 UsingWithAttr
<float> f2
;
35 // expected-warning@+1 {{'UsingWithAttr' is deprecated}}
36 void foo(NoAttr
<short> s1
, UsingWithAttr
<short> s2
) {
39 // expected-note@+2 {{'UsingWithCPPAttr' has been explicitly marked deprecated here}}
41 using UsingWithCPPAttr
[[deprecated
]] = NoAttr
<T
>;
43 // expected-note@+1 {{'UsingInstWithCPPAttr' has been explicitly marked deprecated here}}
44 using UsingInstWithCPPAttr
[[deprecated("Do not use this")]] = NoAttr
<int>;
47 NoAttr
<int> obj
; // Okay
49 // expected-warning@+2 {{'UsingWithAttr' is deprecated}}
50 // expected-note@+1 {{in instantiation of template type alias 'UsingWithAttr' requested here}}
51 UsingWithAttr
<int> objUsingWA
;
53 // expected-warning@+2 {{'UsingWithAttr' is deprecated}}
54 // expected-note@+1 {{in instantiation of template type alias 'UsingWithAttr' requested here}}
55 NoAttr
<UsingWithAttr
<int>> s
;
57 // expected-note@+1 {{'DepInt' has been explicitly marked deprecated here}}
58 using DepInt
[[deprecated
]] = int;
59 // expected-warning@+3 {{'UsingWithAttr' is deprecated}}
60 // expected-warning@+2 {{'DepInt' is deprecated}}
61 // expected-note@+1 {{in instantiation of template type alias 'UsingWithAttr' requested here}}
62 using X
= UsingWithAttr
<DepInt
>;
64 // expected-warning@+2 {{'UsingWithAttr' is deprecated}}
65 // expected-note@+1 {{in instantiation of template type alias 'UsingWithAttr' requested here}}
66 UsingWithAttr
<int>().foo();
68 // expected-warning@+1 {{'UsingInstWithAttr' is deprecated}}
69 UsingInstWithAttr objUIWA
;
71 // expected-warning@+1 {{'TDWithAttr' is deprecated}}
74 // expected-warning@+1 {{'UsingTDWithAttr' is deprecated}}
75 UsingTDWithAttr objUTDWA
;
77 // expected-warning@+2 {{'UsingWithCPPAttr' is deprecated}}
78 // expected-note@+1 {{in instantiation of template type alias 'UsingWithCPPAttr' requested here}}
79 UsingWithCPPAttr
<int> objUsingWCPPA
;
81 // expected-warning@+1 {{'UsingInstWithCPPAttr' is deprecated: Do not use this}}
82 UsingInstWithCPPAttr objUICPPWA
;