1 // RUN: %clang_cc1 -std=c++20 %s -verify 2 3 4 template <auto> struct Nothing {}; 5 Nothing<[]() { return 0; }()> nothing; 6 7 template <typename> struct NothingT {}; 8 Nothing<[]() { return 0; }> nothingT; 9 10 template <typename T> 11 concept True = [] { return true; }(); 12 static_assert(True<int>); 13 14 static_assert(sizeof([] { return 0; })); 15 static_assert(sizeof([] { return 0; }())); 16 17 void f() noexcept(noexcept([] { return 0; }())); 18 19 using a = decltype([] { return 0; }); 20 using b = decltype([] { return 0; }()); 21 using c = decltype([]() noexcept(noexcept([] { return 0; }())) { return 0; }); 22 using d = decltype(sizeof([] { return 0; })); 23 24 template <auto T> 25 int unique_test1(); 26 static_assert(&unique_test1<[](){}> != &unique_test1<[](){}>); 27 28 template <class T> 29 auto g(T) -> decltype([]() { T::invalid; } ()); 30 auto e = g(0); // expected-error{{no matching function for call}} 31 // expected-note@-2 {{substitution failure}} 32