File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
9595
9696 for (auto P : UnnamedParams) {
9797 // Fallback to an unused marker.
98- constexpr StringRef FallbackName = " unused" ;
98+ static constexpr StringRef FallbackName = " unused" ;
9999 StringRef NewName = FallbackName;
100100
101101 // If the method is overridden, try to copy the name from the base method
@@ -129,11 +129,10 @@ void NamedParameterCheck::check(const MatchFinder::MatchResult &Result) {
129129 if (InsertPlainNamesInForwardDecls && IsForwardDeclaration &&
130130 NewName != FallbackName) {
131131 // For forward declarations with InsertPlainNamesInForwardDecls enabled,
132- // insert the parameter name without comments
132+ // insert the parameter name without comments.
133133 D << FixItHint::CreateInsertion (Parm->getLocation (),
134134 " " + NewName.str ());
135135 } else {
136- // Default behavior: insert the parameter name as a comment
137136 D << FixItHint::CreateInsertion (Parm->getLocation (),
138137 " /*" + NewName.str () + " */" );
139138 }
Original file line number Diff line number Diff line change 11// RUN: %check_clang_tidy %s readability-named-parameter %t
2- // RUN: %check_clang_tidy -check-suffix=PLAIN-NAMES %s readability-named-parameter %t -- -config="{CheckOptions: [{key: readability-named-parameter.InsertPlainNamesInForwardDecls, value: true}]}"
2+ // RUN: %check_clang_tidy -check-suffix=PLAIN-NAMES %s readability-named-parameter %t -- \
3+ // RUN: -config="{CheckOptions: [{key: readability-named-parameter.InsertPlainNamesInForwardDecls, value: true}]}"
34
45void Method (char *) { /* */ }
56// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: all parameters should be named in a function
You can’t perform that action at this time.
0 commit comments