1 // RUN: %clang_cc1 -fms-extensions -std=c++11 %s -verify
9 __if_exists(Nontemplate::type
) {
10 typedef Nontemplate::type type
;
13 __if_exists(Nontemplate::value
) {
14 typedef Nontemplate::value type2
;
17 __if_not_exists(Nontemplate::value
) {
21 __if_exists(T::X
) { // expected-warning{{dependent __if_exists declarations are ignored}}
27 X
<int>::type2 i2
; // expected-error{{no type named 'type2' in 'X<int>'}}
29 X
<int>::type4 i4
; // expected-error{{no type named 'type4' in 'X<int>'}}
46 __if_not_exists(T::bar
) {
47 int *i
= t
; // expected-error{{no viable conversion from 'HasFoo' to 'int *'}}
53 __if_exists(T::bar
) {2, }// expected-warning{{dependent __if_exists declarations are ignored}}
58 template void f(HasFoo
); // expected-note{{in instantiation of function template specialization 'f<HasFoo>' requested here}}
59 template void f(HasBar
);
61 template<typename T
, typename
...Ts
>
63 __if_exists(T::operator Ts
) { // expected-error{{__if_exists name contains unexpanded parameter pack 'Ts'}}
66 __if_not_exists(Ts::operator T
) { // expected-error{{__if_not_exists name contains unexpanded parameter pack 'Ts'}}