// { dg-do compile { target c++20 } } // Test deduction requirements. // req12.C template concept SameAs = __is_same_as(T, U); template concept C1 = requires(T t) { // { dg-message "in requirements" } { t } -> SameAs; // NOTE: t deduced as decltype((t)) // { dg-message "does not satisfy" "" { target *-*-* } .-1 } }; template requires C1 constexpr bool f1() { return true; } static_assert(f1()); // { dg-error "" } static_assert(f1()); // { dg-error "" } static_assert(f1()); // { dg-error "" } template concept C2 = requires(T t) { { t } -> SameAs; // NOTE: t deduced as decltype((t)) }; template requires C2 constexpr bool f2() { return true; } static_assert(f2()); // OK