26 lines · cpp
1// Test the setup without incremental extensions first2// RUN: %clang_cc1 -std=c++17 -fdelayed-template-parsing -fpch-instantiate-templates %s -emit-pch -o %t.pch -verify3// RUN: %clang_cc1 -std=c++17 -fdelayed-template-parsing -include-pch %t.pch %s -verify4 5// RUN: %clang_cc1 -std=c++17 -fdelayed-template-parsing -fincremental-extensions -fpch-instantiate-templates %s -emit-pch -o %t.incremental.pch -verify6// RUN: %clang_cc1 -std=c++17 -fdelayed-template-parsing -fincremental-extensions -include-pch %t.incremental.pch %s -verify7 8// expected-no-diagnostics9 10#ifndef PCH11#define PCH12 13// Have one template that is instantiated in the PCH (via the passed option14// -fpch-instantiate-templates) and then serialized15template <typename T> T ft1() { return 0; }16inline int f1() { return ft1<int>(); }17 18// Have a second late-parsed template that needs to be deserialized19template <typename T> T ft2() { return 0; }20 21#else22 23int f2() { return ft2<int>(); }24 25#endif26