summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/arg-comments.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/arg-comments.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/arg-comments.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/arg-comments.cpp b/clang-tools-extra/test/clang-tidy/arg-comments.cpp
new file mode 100644
index 00000000000..32b95767bd2
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/arg-comments.cpp
@@ -0,0 +1,21 @@
+// RUN: clang-tidy --checks=misc-argument-comment %s -- | FileCheck %s
+
+// FIXME: clang-tidy should provide a -verify mode to make writing these checks
+// easier and more accurate.
+
+// CHECK-NOT: warning
+
+void f(int x, int y);
+
+void ffff(int xxxx, int yyyy);
+
+void g() {
+ // CHECK: [[@LINE+5]]:5: warning: argument name 'y' in comment does not match parameter name 'x'
+ // CHECK: :8:12: note: 'x' declared here
+ // CHECK: [[@LINE+3]]:14: warning: argument name 'z' in comment does not match parameter name 'y'
+ // CHECK: :8:19: note: 'y' declared here
+ // CHECK-NOT: warning
+ f(/*y=*/0, /*z=*/0);
+}
+
+// CHECK-NOT: warning
OpenPOWER on IntegriCloud