// RUN: %clang_cc1 -std=c++20 -verify %s // expected-no-diagnostics namespace GH57945 { template concept c = true; template auto f = []() requires c { }; void g() { f(); }; } namespace GH57945_2 { template concept c = true; template auto f = [](auto... args) requires c { }; template auto f2 = [](auto... args) requires (sizeof...(args) > 0) {}; void g() { f(); f2(5.0); } } namespace GH57958 { template concept C = true; template constexpr bool v = [](C auto) { return true; }(0); int _ = v<0>; } namespace GH57958_2 { template concept C = true; template constexpr bool v = [](C auto...) { return true; }(0); int _ = v<0>; } namespace GH57971 { template concept any = true; template auto f = [](any auto) { }; using function_ptr = void(*)(int); function_ptr ptr = f; } // GH58368: A lambda defined in a concept requires we store // the concept as a part of the lambda context. namespace LambdaInConcept { using size_t = unsigned long; template struct IdxSeq{}; template concept NotLike = true; template struct AnyExcept { template T> operator T&() const; template T> operator T&&() const; }; template concept ConstructibleWithN = (requires { [] (IdxSeq) requires requires { T{AnyExcept{}}; } { } (IdxSeq<1,2,3>{}); }); struct Foo { int i; double j; char k; }; static_assert(ConstructibleWithN); }