// PR c++/96443 // { dg-do compile { target c++20 } } template concept same_as = __is_same(T, U); auto f(auto x) -> same_as auto { return 0; }; // { dg-error "constraints" } void g(auto x) { same_as auto y = 0; } // { dg-error "constraints" } auto h(auto x) -> same_as auto { return 0; } // { dg-error "constraints|missing" } template auto N> void i() {} int main() { f(0); // { dg-bogus "" } f(true); // { dg-message "required from here" } g(0); // { dg-bogus "" } g(true); // { dg-message "required from here" } h(0); // { dg-message "required from here" } i(); // { dg-bogus "" } i(); // { dg-error "no match|constraints" } }