File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ findDifferingParamsInDeclaration(const FunctionDecl *ParameterSourceDeclaration,
107107
108108 while (SourceParamIt != ParameterSourceDeclaration->param_end () &&
109109 OtherParamIt != OtherDeclaration->param_end ()) {
110+ if ((*SourceParamIt)->isParameterPack () !=
111+ (*OtherParamIt)->isParameterPack ())
112+ break ;
113+
110114 auto SourceParamName = (*SourceParamIt)->getName ();
111115 auto OtherParamName = (*OtherParamIt)->getName ();
112116
Original file line number Diff line number Diff line change @@ -558,6 +558,11 @@ Changes in existing checks
558558 adding parentheses when the inner expression are implicitly converted
559559 multiple times.
560560
561+ - Improved :doc: `readability-inconsistent-declaration-parameter-name
562+ <clang-tidy/checks/readability/inconsistent-declaration-parameter-name>` check
563+ by not enforcing parameter name consistency between a variadic parameter pack
564+ in the primary template and specific parameters in its specializations.
565+
561566- Improved :doc: `readability-qualified-auto
562567 <clang-tidy/checks/readability/qualified-auto>` check by adding the option
563568 `IgnoreAliasing `, that allows not looking at underlying types of type aliases.
Original file line number Diff line number Diff line change @@ -191,3 +191,26 @@ struct S {
191191void S::f (int y)
192192{
193193}
194+
195+ // ////////////////////////////////////////////////////
196+
197+ template <typename ... Args>
198+ void variadicFunctionNoWarning (Args... args);
199+
200+ template <>
201+ void variadicFunctionNoWarning (int a) {}
202+
203+ template <>
204+ void variadicFunctionNoWarning (int a, int b) {}
205+
206+ template <typename ... Args>
207+ void variadicFunction2WithWarning (int fixed, Args... args);
208+
209+ template <>
210+ void variadicFunction2WithWarning (int fixed, int a) {}
211+
212+ template <>
213+ // CHECK-MESSAGES: :[[@LINE+3]]:6: warning: function template specialization 'variadicFunction2WithWarning<float>' has a primary template
214+ // CHECK-MESSAGES: :[[@LINE-7]]:6: note: the primary template declaration seen here
215+ // CHECK-MESSAGES: :[[@LINE+1]]:6: note: differing parameters are named here: ('wrong'), in primary template declaration: ('fixed')
216+ void variadicFunction2WithWarning (int wrong, float a) {}
You can’t perform that action at this time.
0 commit comments