[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / PCH / pch-instantiate-templates-forward-decl.cpp
bloba7b418df1fa4f457bea6d466582e15a222d850ec
1 // Test this without pch.
2 // RUN: %clang_cc1 -fsyntax-only %s -DBODY
4 // Test with pch.
5 // RUN: %clang_cc1 -emit-pch -o %t %s
6 // RUN: %clang_cc1 -include-pch %t -fsyntax-only %s -DBODY
8 // Test with pch with template instantiation in the pch.
9 // RUN: %clang_cc1 -emit-pch -fpch-instantiate-templates -o %t %s -verify
11 #ifndef HEADER_H
12 #define HEADER_H
14 template <typename T>
15 void f();
16 struct X; // @16
17 void g() { f<X>(); } // @17 instantiation not performed yet
19 template <typename T>
20 void f() { T t; }; // @20
22 #endif
24 #ifdef BODY
25 struct X {};
26 #endif
28 // expected-error@20 {{variable has incomplete type}}
29 // expected-note@17 {{in instantiation of function template specialization}}
30 // expected-note@16 {{forward declaration}}