https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66092
--- Comment #1 from Ying-Po Liao <yingpo.liao at gmail dot com> --- Here's another implementation, which results in the same consequence. template <typename T, typename U, typename... Args> struct Checker { constexpr static decltype(auto) check( std::true_type ) { return std::integral_constant<bool, __is_same_as(T, U)>(); } constexpr static decltype(auto) check( std::false_type ) { return std::integral_constant<bool, __is_same_as(T, U) && Checker<U, Args...>::value>(); } constexpr static bool value = decltype( check( std::integral_constant<bool, (sizeof...(Args)==0)>() ) )::value; }; template <typename T, typename U, typename... Args> concept bool Same() { return Checker<T, U, Args...>::value; }