1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3template <typename T>
4class SmallVectorImpl  {
5public:
6  explicit SmallVectorImpl(unsigned N) {
7  }
8
9  ~SmallVectorImpl() { }
10
11};
12
13template <typename T, unsigned N>
14class SmallVector : public SmallVectorImpl<T> {
15  typedef typename SmallVectorImpl<T>::U U; // expected-error {{no type named 'U' in 'SmallVectorImpl<CallSite>'}}
16  enum {
17
18    MinUs = (static_cast<unsigned int>(sizeof(T))*N +	// expected-error {{invalid application of 'sizeof' to an incomplete type 'CallSite'}}
19             static_cast<unsigned int>(sizeof(U)) - 1) /
20            static_cast<unsigned int>(sizeof(U)),
21    NumInlineEltsElts = MinUs
22  };
23  U InlineElts[NumInlineEltsElts];
24public:
25  SmallVector() : SmallVectorImpl<T>(NumInlineEltsElts) {
26  }
27
28};
29
30class CallSite;	// expected-note {{forward declaration of 'CallSite'}}
31class InlineFunctionInfo {
32public:
33  explicit InlineFunctionInfo() {}
34  SmallVector<CallSite, 2> DevirtualizedCalls;	// expected-note {{in instantiation of template class 'SmallVector<CallSite, 2>' requested}}
35};
36