[PATCH] D125885: [clang-tidy] bugprone-argument-comment: Ignore calls to user-defined literals
Joachim Priesner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 18 07:30:38 PDT 2022
jspam updated this revision to Diff 430375.
jspam added a comment.
Fix test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125885/new/
https://reviews.llvm.org/D125885
Files:
clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp
Index: clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp
@@ -5,6 +5,8 @@
void ffff(int xxxx, int yyyy);
+int operator""_op(unsigned long long val);
+
void f(int x, int y);
void g() {
// CHECK-NOTES: [[@LINE+4]]:5: warning: argument name 'y' in comment does not match parameter name 'x'
@@ -14,7 +16,15 @@
f(/*y=*/0, /*z=*/0);
// CHECK-FIXES: {{^}} f(/*y=*/0, /*z=*/0);
+ // CHECK-NOTES: [[@LINE+4]]:5: warning: argument name 'y' in comment does not match parameter name 'x'
+ // CHECK-NOTES: [[@LINE-10]]:12: note: 'x' declared here
+ // CHECK-NOTES: [[@LINE+2]]:17: warning: argument name 'z' in comment does not match parameter name 'y'
+ // CHECK-NOTES: [[@LINE-12]]:19: note: 'y' declared here
+ f(/*y=*/0_op, /*z=*/0_op);
+ // CHECK-FIXES: {{^}} f(/*y=*/0_op, /*z=*/0_op);
+
f(/*x=*/1, /*y=*/1);
+ f(/*x=*/1_op, /*y=*/1_op);
ffff(0 /*aaaa=*/, /*bbbb*/ 0); // Unsupported formats.
}
Index: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
@@ -60,7 +60,7 @@
void ArgumentCommentCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
- callExpr(unless(cxxOperatorCallExpr()),
+ callExpr(unless(cxxOperatorCallExpr()), unless(userDefinedLiteral()),
// NewCallback's arguments relate to the pointed function,
// don't check them against NewCallback's parameter names.
// FIXME: Make this configurable.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125885.430375.patch
Type: text/x-patch
Size: 1875 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220518/f4731797/attachment.bin>
More information about the cfe-commits
mailing list