[libcxx-commits] [libcxx] [libc++][ratio] Avoids accepting unrelated types. (PR #80491)

Will Hawkins via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 2 13:40:33 PST 2024


================
@@ -289,6 +289,9 @@ private:
   static const intmax_t __gcd_n1_d2 = __static_gcd<_R1::num, _R2::den>::value;
   static const intmax_t __gcd_d1_n2 = __static_gcd<_R1::den, _R2::num>::value;
 
+  static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialication of the ratio template");
----------------
hawkinsw wrote:

Here (and throughout), do we want this to be ... 
```suggestion
  static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialization of the ratio template");
```

https://github.com/llvm/llvm-project/pull/80491


More information about the libcxx-commits mailing list