// { dg-do compile { target concepts } } template concept same_as = __is_same(T, U); same_as auto f(auto, auto y) { return y; // { dg-error "deduced return type" } } template struct A { static auto g(auto x, auto y) -> same_as auto { return y; // { dg-error "deduced return type" } } }; int main() { f(0, 0); // { dg-bogus "" } f("", 0); // { dg-bogus "" } f(0, ""); // { dg-message "required from here" } f("", ""); // { dg-message "required from here" } A::g(0, 0); // { dg-bogus "" } A::g("", 0); // { dg-message "required from here" } A::g(0, ""); // { dg-message "required from here" } A::g("", ""); // { dg-bogus "" } }