llvm-project
33 строки · 1015.0 Байт
1// Test this without pch.
2// RUN: %clang_cc1 -include %S/cxx-friends.h -fsyntax-only -verify %s
3
4// Test with pch.
5// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h
6// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize
7
8// Test with pch and template instantiation in the pch.
9// RUN: %clang_cc1 -x c++-header -emit-pch -fpch-instantiate-templates -o %t %S/cxx-friends.h
10// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize
11
12// Test with modules.
13// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h -fmodules
14// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize -fmodules
15
16// expected-no-diagnostics
17
18class F {
19void m() {
20A* a;
21a->x = 0;
22}
23};
24
25template<typename T> class PR12585::future_base::setter {
26public:
27int f() {
28return promise<T*>().k;
29}
30};
31int k = PR12585::future_base::setter<int>().f();
32
33Lazy::S *p;
34