[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / invalid-instantiated-field-decl.cpp
blob8b26489d94d180edb5165b5ce6e4e3ac526cf3a2
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 template <typename T>
4 class SmallVectorImpl {
5 public:
6 explicit SmallVectorImpl(unsigned N) {
9 ~SmallVectorImpl() { }
13 template <typename T, unsigned N>
14 class SmallVector : public SmallVectorImpl<T> {
15 typedef typename SmallVectorImpl<T>::U U; // expected-error {{no type named 'U' in 'SmallVectorImpl<CallSite>'}}
16 enum {
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
23 U InlineElts[NumInlineEltsElts];
24 public:
25 SmallVector() : SmallVectorImpl<T>(NumInlineEltsElts) {
30 class CallSite; // expected-note {{forward declaration of 'CallSite'}}
31 class InlineFunctionInfo {
32 public:
33 explicit InlineFunctionInfo() {}
34 SmallVector<CallSite, 2> DevirtualizedCalls; // expected-note {{in instantiation of template class 'SmallVector<CallSite, 2>' requested}}