When a constrained-type-specifier is the same as that of a parameter type, the return type is not deduced. template<typename T> concept bool C = true; C f(C) { return 0; } void g() { auto x = f("x"); static_assert(std::is_same<decltype(x), int>::value); } The static assertion should fail.
Bug 69448 appears to be related.
Is this true? With the following updated C++20 testcase, clang, GCC and MSVC all cause the static_assert to pass: #include <type_traits> template<typename T> concept C = true; C auto f(C auto) { return 0; } void g() { auto x = f("x"); static_assert(std::is_same<decltype(x), int>::value); }