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.


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.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to