diff --git a/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp --- a/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp +++ b/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. diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/bugprone-argument-comment.cpp +++ b/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]]:14: 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. }