[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / PCH / cxx20-unevaluated-lambda.cpp
blob29af5e61c33072dd03945474ae340037025046ee
1 // RUN: %clang_cc1 -std=c++20 -include %s %s -o %t
3 // RUN: %clang_cc1 -std=c++20 -emit-pch %s -o %t
4 // RUN: %clang_cc1 -std=c++20 -include-pch %t -verify %s
6 // expected-no-diagnostics
8 #ifndef HEADER
9 #define HEADER
11 template<typename T> auto f() -> decltype([]{ return T(42); });
13 #else /*included pch*/
15 static_assert(decltype(f<int>())()() == 42);
17 #endif // HEADER