1 // RUN: %clang_cc1 -fsyntax-only -verify %s
6 T y
; // expected-error{{data member instantiated with function type}}
8 T bitfield
: 12; // expected-error{{bit-field 'bitfield' has non-integral type 'float'}} \
9 // expected-error{{data member instantiated with function type}}
11 mutable T x2
; // expected-error{{data member instantiated with function type}}
14 void test1(const X
<int> *xi
) {
16 const int &i2
= xi
->y
;
18 int i3
= xi
->bitfield
;
22 void test2(const X
<float> *xf
) {
23 (void)xf
->x
; // expected-note{{in instantiation of template class 'X<float>' requested here}}
26 void test3(const X
<int(int)> *xf
) {
27 (void)xf
->x
; // expected-note{{in instantiation of template class 'X<int (int)>' requested here}}
31 template <class > struct requirement_
;
33 template <void(*)()> struct instantiate
36 template <class > struct requirement
;
39 template <class Model
> struct requirement
<failed
*Model::*>
43 ((Model
*)0)->~Model(); // expected-note{{in instantiation of}}
47 template <class Model
> struct requirement_
<void(*)(Model
)> : requirement
<failed
*Model::*>
50 template <int> struct Requires_
51 { typedef void type
; };
53 template <class Model
> struct usage_requirements
56 {((Model
*)0)->~Model(); } // expected-note{{in instantiation of}}
59 template < typename TT
> struct BidirectionalIterator
64 instantiate
< requirement_
<void(*)(usage_requirements
<BidirectionalIterator
>)>::failed
> int534
; // expected-note{{in instantiation of}}
66 ~BidirectionalIterator()
67 { i
--; } // expected-error{{cannot decrement value of type 'PR7123::X'}}
75 template<typename RanIter
>
76 typename Requires_
< BidirectionalIterator
<RanIter
>::value
>::type
sort(RanIter
,RanIter
){}
86 template<typename T1
> class A
{
87 class D
; // expected-note{{declared here}}
88 D d
; //expected-error{{implicit instantiation of undefined member 'PR7355::A<int>::D'}}
91 A
<int> ai
; // expected-note{{in instantiation of}}
98 B(const unsigned char i
);
99 unsigned char value
: (dim
> 0 ? dim
: 1);
103 inline B
<dim
>::B(const unsigned char i
) : value(i
) {}