// PR c++/96410 // { dg-do compile { target c++20 } } struct S { using blah = void; }; template constexpr bool trait = !__is_same(T, S); template concept C = trait; template void foo() noexcept(!__is_same(T, void)) { } template auto f() { return [](T, bool a = requires { C; }){ // { dg-warning Wmissing-requires } static_assert(requires { requires C && (C || C); }); // { dg-error "assert" } static_assert(requires { C; }); // { dg-warning Wmissing-requires } static_assert(requires { { foo() } noexcept -> C; }); static_assert(!requires { typename T::blah; }); // { dg-error "assert" } return 0; }; } auto g = f(); // { dg-bogus "" } int n = g(0); // { dg-bogus "" } int m = g(S{}); // { dg-message "required from here" }