34 lines · cpp
1// Test this without pch.2// RUN: %clang_cc1 -include %S/cxx-friends.h -fsyntax-only -verify %s3 4// Test with pch.5// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h6// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize7 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.h10// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize11 12// Test with modules.13// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-friends.h -fmodules14// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s -error-on-deserialized-decl doNotDeserialize -fmodules15 16// expected-no-diagnostics17 18class F {19 void m() {20 A* a;21 a->x = 0;22 }23};24 25template<typename T> class PR12585::future_base::setter {26public:27 int f() {28 return promise<T*>().k;29 }30};31int k = PR12585::future_base::setter<int>().f();32 33Lazy::S *p;34