[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / PCH / implicitly-deleted.cpp
blob669bdac16980196d4b9c9812b31cfe6a88ad5357
1 // RUN: %clang_cc1 -std=c++11 -x c++-header %s -emit-pch -o %t.pch
2 // RUN: %clang_cc1 -std=c++11 -x c++ /dev/null -include-pch %t.pch
4 // RUN: %clang_cc1 -std=c++11 -x c++-header %s -emit-pch -fpch-instantiate-templates -o %t.pch
5 // RUN: %clang_cc1 -std=c++11 -x c++ /dev/null -include-pch %t.pch
7 class move_only { move_only(const move_only&) = delete; move_only(move_only&&); };
8 struct sb {
9 move_only il;
10 sb();
11 sb(sb &&);
14 template<typename T> T make();
15 template<typename T> void doit(decltype(T(make<const T&>()))*) { T(make<const T&>()); }
16 template<typename T> void doit(...) { T(make<T&&>()); }
17 template<typename T> void later() { doit<T>(0); }
19 void fn1() {
20 sb x;
21 later<sb>();