brintos

brintos / llvm-project-archived public Read only

0
0
Text · 739 B · a7b418d Raw
31 lines · cpp
1// Test this without pch.2// RUN: %clang_cc1 -fsyntax-only %s -DBODY3 4// Test with pch.5// RUN: %clang_cc1 -emit-pch -o %t %s6// RUN: %clang_cc1 -include-pch %t -fsyntax-only %s -DBODY7 8// Test with pch with template instantiation in the pch.9// RUN: %clang_cc1 -emit-pch -fpch-instantiate-templates -o %t %s -verify10 11#ifndef HEADER_H12#define HEADER_H13 14template <typename T>15void f();16struct X;            // @1617void g() { f<X>(); } // @17 instantiation not performed yet18 19template <typename T>20void f() { T t; }; // @2021 22#endif23 24#ifdef BODY25struct X {};26#endif27 28// expected-error@20 {{variable has incomplete type}}29// expected-note@17 {{in instantiation of function template specialization}}30// expected-note@16 {{forward declaration}}31