Files
clang-p2996/clang/test/SemaTemplate/instantiate-field.cpp
John McCall 85f9055955 When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.

llvm-svn: 98149
2010-03-10 11:27:22 +00:00

29 lines
835 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
template<typename T>
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<int> *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<float> *xf) {
(void)xf->x; // expected-note{{in instantiation of template class 'X<float>' requested here}}
}
void test3(const X<int(int)> *xf) {
(void)xf->x; // expected-note{{in instantiation of template class 'X<int (int)>' requested here}}
}