Skip to content

Commit 98c4c9c

Browse files
committed
More comments resolved.
1 parent 4518c1e commit 98c4c9c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang-tools-extra/clang-tidy/readability/NamedParameterCheck.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

clang-tools-extra/test/clang-tidy/checkers/readability/named-parameter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
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

45
void Method(char *) { /* */ }
56
// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: all parameters should be named in a function

0 commit comments

Comments
 (0)