[clang-tools-extra] [clang-tidy] Fix false positive in `readability-redundant-typename` (PR #170034)
Victor Chernyakin via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 2 13:36:08 PST 2025
================
@@ -267,3 +267,17 @@ WHOLE_TYPE_IN_MACRO Macro2;
#define WHOLE_DECLARATION_IN_MACRO typename NotDependent::R Macro3
WHOLE_DECLARATION_IN_MACRO;
+
+template<typename T> struct ListWrapper {};
+template<typename T>
+class ClassWrapper {
+public:
+ using Argument = ListWrapper<T>;
+ ListWrapper<Argument> arguments;
+ ListWrapper<Argument> getArguments() const;
+};
+template<typename T>
+ListWrapper<typename ClassWrapper<T>::Argument> ClassWrapper<T>::getArguments() const {
+ return arguments;
+}
----------------
localspook wrote:
This test case could be reduced:
```suggestion
template <typename T> struct Wrapper {};
template <typename T>
struct ClassWrapper {
using R = T;
Wrapper<R> f();
};
template <typename T>
Wrapper<typename ClassWrapper<T>::R> ClassWrapper<T>::f() {
return {};
}
```
(you can verify it still causes the FP: https://godbolt.org/z/vEx4GbaMa)
https://github.com/llvm/llvm-project/pull/170034
More information about the cfe-commits
mailing list