File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %check_clang_tidy -std=c++98 %s readability-redundant-typename %t \
2
+ // RUN: -- -- -fno-delayed-template-parsing
3
+
4
+ struct NotDependent {
5
+ typedef int R;
6
+ };
7
+
8
+ template <typename T>
9
+ typename T::R f () {
10
+ static_cast <typename T::R>(0 );
11
+
12
+ typename NotDependent::R NotDependentVar;
13
+ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: redundant 'typename' [readability-redundant-typename]
14
+ // CHECK-FIXES: NotDependent::R NotDependentVar;
15
+
16
+ void notDependentFunctionDeclaration (typename NotDependent::R);
17
+ // CHECK-MESSAGES: :[[@LINE-1]]:40: warning: redundant 'typename' [readability-redundant-typename]
18
+ // CHECK-FIXES: void notDependentFunctionDeclaration(NotDependent::R);
19
+ }
Original file line number Diff line number Diff line change @@ -122,8 +122,14 @@ struct PartiallySpecializedType {};
122
122
template <typename T>
123
123
struct PartiallySpecializedType <T, typename T::R> {};
124
124
125
+ #if __cplusplus >= 201402L
126
+
125
127
template <typename T>
126
- auto v = typename T::type ();
128
+ typename T::R v = typename T::R ();
129
+ // CHECK-MESSAGES-20: :[[@LINE-1]]:1: warning: redundant 'typename' [readability-redundant-typename]
130
+ // CHECK-FIXES-20: T::R v = typename T::R();
131
+
132
+ #endif // __cplusplus >= 201402L
127
133
128
134
template <typename T>
129
135
typename T::R f ();
You can’t perform that action at this time.
0 commit comments