[clang-tools-extra] [clang-tidy] Don't suggest tuple_size_v in constraints in type-traits (PR #235257)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 24 01:52:30 PDT 2026


================
@@ -55,3 +55,9 @@ Limitations
 Does not currently diagnose uses of type traits with nested name
 specifiers (e.g. ``std::chrono::is_clock``,
 ``std::chrono::treat_as_floating_point``).
+
+Does not diagnose ``std::tuple_size<T>::value`` and
+``std::variant_size<T>::value`` inside requires-expressions, concept definitions
+and requires-clauses. There, a substitution failure in the ``::value`` form
+makes the constraint unsatisfied, while ``std::tuple_size_v<T>`` and
+``std::variant_size_v<T>`` would cause a hard error instead.
----------------
zwuis wrote:

You added this to the _Limitations_ section. Did you mean we can handle it correctly, but we don't do it currently?

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


More information about the cfe-commits mailing list