// 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'}} }