================
@@ -0,0 +1,26 @@
+.. title:: clang-tidy - readability-redundant-typename
+
+readability-redundant-typename
+==============================
+
+Finds unnecessary uses of the ``typename`` keyword.
+
+``typename`` is unnecessary in two cases. First, before non-dependent names:
+
+.. code-block:: c++
+
+ /* typename */ std::vector<int>::size_type size;
+
+And second, since C++20, before dependent names that appear in a context
+where only a type is allowed (the following example shows just a few of them):
+
+.. code-block:: c++
+
+ template <typename T>
+ using trait = /* typename */ T::type;
+
+ template <typename T>
+ struct S {
+ /* typename */ T::type variable;
+ /* typename */ T::type function(/* typename */ T::type);
+ };
----------------
vbvictor wrote:
Oh, okay maybe then not all cases but at least some interesting once from
`C++20`.
Maybe thats my personal bias, but I'd like some examples in docs that "give a
taste" how the check would improve code.
https://github.com/llvm/llvm-project/pull/161574
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits