// RUN: %clang_cc1 -std=c++20 -verify %s namespace PR47043 { template concept True = true; template concept AllTrue1 = True; // expected-error {{expression contains unexpanded parameter pack 'T'}} template concept AllTrue2 = (True && ...); static_assert(AllTrue2); } namespace PR47025 { template concept AllAddable1 = requires(T ...t) { (void(t + 1), ...); }; template concept AllAddable2 = (requires(T ...t) { (t + 1); } && ...); // expected-error {{requirement contains unexpanded parameter pack 't'}} template concept AllAddable3 = (requires(T t) { (t + 1); } && ...); template concept AllAddable4 = requires(T t) { (t + 1); }; // expected-error {{expression contains unexpanded parameter pack 'T'}} template concept AllAddable5 = requires(T t) { (void(t + 1), ...); }; // expected-error {{does not contain any unexpanded}} template concept AllAddable6 = (requires { (T() + 1); } && ...); template concept AllAddable7 = requires { (T() + 1); }; // expected-error {{expression contains unexpanded parameter pack 'T'}} static_assert(AllAddable1); static_assert(AllAddable3); static_assert(AllAddable6); static_assert(!AllAddable1); static_assert(!AllAddable3); static_assert(!AllAddable6); } namespace PR45699 { template concept C = true; // expected-note 2{{here}} template void f1a() requires C; // expected-error {{requires clause contains unexpanded parameter pack 'Ts'}} template requires C void f1b(); // expected-error {{requires clause contains unexpanded parameter pack 'Ts'}} template void f2a() requires (C && ...); template requires (C && ...) void f2b(); template void f3a() requires C; // expected-error {{pack expansion used as argument for non-pack parameter of concept}} template requires C void f3b(); // expected-error {{pack expansion used as argument for non-pack parameter of concept}} template void f4() { ([] () requires C {} ()); // expected-error {{expression contains unexpanded parameter pack 'Ts'}} ([] requires C () {} ()); // expected-error {{expression contains unexpanded parameter pack 'Ts'}} } template void f5() { ([] () requires C {} (), ...); ([] requires C () {} (), ...); } void g() { f1a(); f1b(); // FIXME: Bad error recovery. expected-error {{undeclared identifier}} f2a(); f2b(); f3a(); f3b(); // FIXME: Bad error recovery. expected-error {{undeclared identifier}} f4(); f5(); } } namespace P0857R0 { void f() { auto x = [] requires B {}; // expected-note {{constraints not satisfied}} expected-note {{false}} x.operator()(); x.operator()(); // expected-error {{no matching member function}} } // FIXME: This is valid under P0857R0. template concept C = true; template requires C typename U> struct X {}; // expected-error {{requires 'class'}} expected-error 0+{{}} template requires C struct Y {}; X xy; // expected-error {{no template named 'X'}} } namespace PR50306 { template concept NotInt = sizeof(T) != sizeof(int); // expected-note {{because}} template void f() { [](NotInt auto) {}(T()); // expected-error {{no matching function}} expected-note {{constraints not satisfied}} expected-note {{because}} } template void f(); // OK template void f(); // expected-note {{in instantiation of}} } namespace PackInTypeConstraint { template concept C = sizeof(T) == sizeof(int); // expected-note 3{{}} template U> void h1(); // expected-error {{type constraint contains unexpanded parameter pack 'T'}} template ...U> void h2(); template void h3(C auto); // expected-error {{type constraint contains unexpanded parameter pack 'T'}} template void h4(C auto...); template void f1() { [] U>(U u){}(T()); // expected-error {{unexpanded parameter pack 'T'}} } template void f2() { ([] U>(U u){}(T()), ...); // expected-error {{no match}} expected-note 2{{}} } template void f2(); // OK template void f2(); // expected-note {{in instantiation of}} void f3() { ([] U>(U u){}(0), // expected-error {{type constraint contains unexpanded parameter pack 'T'}} ...); // expected-error {{does not contain any unexpanded}} } template void g1() { [](C auto){}(T()); // expected-error {{expression contains unexpanded parameter pack 'T'}} } template void g2() { ([](C auto){}(T()), ...); // expected-error {{no matching function}} expected-note {{constraints not satisfied}} expected-note {{because}} } template void g2(); // OK template void g2(); // expected-note {{in instantiation of}} void g3() { ([](C auto){}(1), // expected-error {{type constraint contains unexpanded parameter pack 'T'}} ...); // expected-error {{does not contain any unexpanded}} } template void g4() { []() -> C auto{ return T(); }(); // expected-error {{expression contains unexpanded parameter pack 'T'}} } template void g5() { ([]() -> C auto{ // expected-error-re {{deduced type {{.*}} does not satisfy}} return T(); }(), ...); } template void g5(); // OK template void g5(); // expected-note {{in instantiation of}} void g6() { ([]() -> C auto{ // expected-error {{declaration type contains unexpanded parameter pack 'T'}} return T(); // expected-error {{expression contains unexpanded parameter pack 'T'}} }(), ...); // expected-error {{does not contain any unexpanded}} } }