https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71954
--- Comment #2 from Vladislav Suratov <suratovvlad at gmail dot com> --- Confirmed with 9.3, 10.1 and current trunk (11.0). Tested with --std=c++17, meanwhile clang 10.0 (and trunk) and MSVC 19.24 and MSVC 19.25 successfully compile it. The following example is what I used for testing: #include <ratio> struct Test1 { template <typename _Ty> struct Helper1{ static constexpr bool value = false; }; template <intmax_t _R1, intmax_t _R2> struct Helper1<std::ratio<_R1, _R2>>{ static constexpr bool value = true; }; }; struct Test2 { template <typename _Ty> static constexpr bool Helper1 = false; template <intmax_t _R1, intmax_t _R2> static constexpr bool Helper1<std::ratio<_R1, _R2>> = true; }; static_assert(Test1::Helper1<std::ratio<1, 1000>>::value, "Check"); static_assert(Test2::Helper1<std::ratio<1, 1000>>, "Check");