summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/warn-documentation.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2013-12-17 22:06:11 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2013-12-17 22:06:11 +0000
commitfa68a57cf71d20b2e0e02db32fd2e6a0fc2da1f8 (patch)
tree09c9c0cdc61cb233812a382f55e3a55e854ce224 /clang/test/Sema/warn-documentation.cpp
parent2553e49a5d7893c9a0d3846153a2536893fa5744 (diff)
downloadbcm5719-llvm-fa68a57cf71d20b2e0e02db32fd2e6a0fc2da1f8.tar.gz
bcm5719-llvm-fa68a57cf71d20b2e0e02db32fd2e6a0fc2da1f8.zip
Documentation comment parsing: allow \param and \returns on std::function,
boost::function and similar function-like objects llvm-svn: 197528
Diffstat (limited to 'clang/test/Sema/warn-documentation.cpp')
-rw-r--r--clang/test/Sema/warn-documentation.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/test/Sema/warn-documentation.cpp b/clang/test/Sema/warn-documentation.cpp
index a8b9ea520a6..00c56015b6c 100644
--- a/clang/test/Sema/warn-documentation.cpp
+++ b/clang/test/Sema/warn-documentation.cpp
@@ -275,6 +275,21 @@ int test_param21(int a);
/// \param x2 Ccc.
int test_param22(int x1, int x2, int x3);
+//===---
+// Test that we treat typedefs to some non-function types as functions for the
+// purposes of documentation comment parsing.
+//===---
+
+namespace foo {
+ inline namespace bar {
+ template<typename>
+ struct function_wrapper {};
+
+ template<unsigned>
+ struct not_a_function_wrapper {};
+ }
+};
+
// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
/// \param aaa Meow.
/// \param bbb Bbb.
@@ -299,6 +314,19 @@ typedef int (* const test_function_like_typedef3)(int aaa, int ccc);
/// \returns aaa.
typedef int (C::*test_function_like_typedef4)(int aaa, int ccc);
+// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
+/// \param aaa Meow.
+/// \param bbb Bbb.
+/// \returns aaa.
+typedef foo::function_wrapper<int (int aaa, int ccc)> test_function_like_typedef5;
+
+// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
+/// \param aaa Meow.
+/// \param bbb Bbb.
+/// \returns aaa.
+typedef foo::function_wrapper<int (int aaa, int ccc)> *test_function_like_typedef6;
+
+
typedef int (*test_not_function_like_typedef1)(int aaa);
// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
@@ -311,6 +339,9 @@ typedef test_not_function_like_typedef1 test_not_function_like_typedef2;
/// @param aaa Meow.
typedef unsigned int test_not_function_like_typedef3;
+// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
+/// \param aaa Meow.
+typedef foo::not_a_function_wrapper<1> test_not_function_like_typedef4;
/// \param aaa Aaa
/// \param ... Vararg
OpenPOWER on IntegriCloud