[clang-tools-extra] aa7773b - [clang-tidy] Add regression tests for readability-redundant-typename. NFC. (#207318)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 2 22:59:58 PDT 2026
Author: Zeyi Xu
Date: 2026-07-03T13:59:54+08:00
New Revision: aa7773bef31df88130002748881118cb9982f0c7
URL: https://github.com/llvm/llvm-project/commit/aa7773bef31df88130002748881118cb9982f0c7
DIFF: https://github.com/llvm/llvm-project/commit/aa7773bef31df88130002748881118cb9982f0c7.diff
LOG: [clang-tidy] Add regression tests for readability-redundant-typename. NFC. (#207318)
Part of https://github.com/llvm/llvm-project/issues/206995
Added:
Modified:
clang-tools-extra/test/clang-tidy/checkers/readability/redundant-typename.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/redundant-typename.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/redundant-typename.cpp
index e2be40530865f..c4021662264f4 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/readability/redundant-typename.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/readability/redundant-typename.cpp
@@ -378,3 +378,22 @@ template <typename T>
struct SubClass : BaseClass<typename T::R> {};
template struct SubClass<Int>;
+
+template <typename T>
+struct Sink {};
+
+template <typename...>
+using VoidT = void;
+
+template <typename C, typename = void>
+inline constexpr bool HasValueType = false;
+
+template <typename C>
+inline constexpr bool HasValueType<C, VoidT<typename C::value_type>> =
+ sizeof(Sink<typename C::value_type>) != 0;
+
+struct IntVector {
+ using value_type = int;
+};
+
+static_assert(HasValueType<IntVector>);
More information about the cfe-commits
mailing list