summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/warn-documentation-fixits.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-08-01 23:27:13 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-08-01 23:27:13 +0000
commitfae2e4ed0ab553c2136749ac02f608cf2d2cba59 (patch)
tree9885e00abd1a804ee8745141b873a8564864424e /clang/test/Sema/warn-documentation-fixits.cpp
parente6213ddabcee982f029cfb657089be896695a934 (diff)
downloadbcm5719-llvm-fae2e4ed0ab553c2136749ac02f608cf2d2cba59.tar.gz
bcm5719-llvm-fae2e4ed0ab553c2136749ac02f608cf2d2cba59.zip
Comment diagnostics: add tests for \tparam fixits.
llvm-svn: 161142
Diffstat (limited to 'clang/test/Sema/warn-documentation-fixits.cpp')
-rw-r--r--clang/test/Sema/warn-documentation-fixits.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/Sema/warn-documentation-fixits.cpp b/clang/test/Sema/warn-documentation-fixits.cpp
new file mode 100644
index 00000000000..f67ae46ad12
--- /dev/null
+++ b/clang/test/Sema/warn-documentation-fixits.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wdocumentation -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+/// \param ZZZZZZZZZZ Blah blah. expected-warning {{parameter 'ZZZZZZZZZZ' not found in the function declaration}} expected-note {{did you mean 'a'?}}
+int test1(int a);
+
+/// \param aab Blah blah. expected-warning {{parameter 'aab' not found in the function declaration}} expected-note {{did you mean 'aaa'?}}
+int test2(int aaa, int bbb);
+
+// expected-warning@+1 {{template parameter 'ZZZZZZZZZZ' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}
+/// \tparam ZZZZZZZZZZ Aaa
+template<typename T>
+void test3(T aaa);
+
+// expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}}
+/// \tparam SomTy Aaa
+/// \tparam OtherTy Bbb
+template<typename SomeTy, typename OtherTy>
+void test4(SomeTy aaa, OtherTy bbb);
+
+// CHECK: fix-it:"{{.*}}":{4:12-4:22}:"a"
+// CHECK: fix-it:"{{.*}}":{7:12-7:15}:"aaa"
+// CHECK: fix-it:"{{.*}}":{11:13-11:23}:"T"
+// CHECK: fix-it:"{{.*}}":{16:13-16:18}:"SomeTy"
+
OpenPOWER on IntegriCloud