// PR c++/67159 // { dg-do compile { target c++17 } } // { dg-options "-fconcepts -fconcepts-diagnostics-depth=2" } template concept SameAs = __is_same_as(T, U); template concept R1 = requires (T& t) { { t.begin() } -> T; // { dg-error "no matching|return-type-requirement|too many" } { t.end() } -> SameAs; // { dg-error "deduced expression type" } }; template concept R2 = requires (T& t) { { t.end() } -> SameAs; // { dg-error "deduced expression type" } }; struct foo { int* begin(); int* end(); }; template constexpr bool f() { return true; } template constexpr bool g() { return true; } static_assert(f()); // { dg-error "" } static_assert(g()); // { dg-error "" }