// RUN: %clang_cc1 -fsyntax-only -verify %s template struct X { int x; T y; // expected-error{{data member instantiated with function type}} T* z; T bitfield : 12; // expected-error{{bit-field 'bitfield' has non-integral type 'float'}} \ // expected-error{{data member instantiated with function type}} mutable T x2; // expected-error{{data member instantiated with function type}} }; void test1(const X *xi) { int i1 = xi->x; const int &i2 = xi->y; int* ip1 = xi->z; int i3 = xi->bitfield; xi->x2 = 17; } void test2(const X *xf) { (void)xf->x; // expected-note{{in instantiation of template class 'X' requested here}} } void test3(const X *xf) { (void)xf->x; // expected-note{{in instantiation of template class 'X' requested here}} } namespace PR7123 { template struct requirement_; template struct instantiate { }; template struct requirement ; struct failed ; template struct requirement { static void failed() { ((Model*)0)->~Model(); // expected-note{{in instantiation of}} } }; template struct requirement_ : requirement { }; template struct Requires_ { typedef void type; }; template struct usage_requirements { ~usage_requirements() {((Model*)0)->~Model(); } // expected-note{{in instantiation of}} }; template < typename TT > struct BidirectionalIterator { enum { value = 0 }; instantiate< requirement_)>::failed> int534; // expected-note{{in instantiation of}} ~BidirectionalIterator() { i--; } // expected-error{{cannot decrement value of type 'PR7123::X'}} TT i; }; struct X { }; template typename Requires_< BidirectionalIterator::value >::type sort(RanIter,RanIter){} void f() { X x; sort(x,x); } } namespace PR7355 { template class A { class D; // expected-note{{declared here}} D d; //expected-error{{implicit instantiation of undefined member 'PR7355::A::D'}} }; A ai; // expected-note{{in instantiation of}} } namespace PR8712 { template class B { public: B(const unsigned char i); unsigned char value : (dim > 0 ? dim : 1); }; template inline B::B(const unsigned char i) : value(i) {} }