summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2013-06-23 23:33:14 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2013-06-23 23:33:14 +0000
commit761f801cb2e1d0e07a194a24ad9d2a9cf6e8e694 (patch)
tree74defb7c5616f1665f5cd506f2620e7e3f612224
parent27cb3dd085ff6da9af03cb80b799c7613f1a8d24 (diff)
downloadbcm5719-llvm-761f801cb2e1d0e07a194a24ad9d2a9cf6e8e694.tar.gz
bcm5719-llvm-761f801cb2e1d0e07a194a24ad9d2a9cf6e8e694.zip
Documentation parsing: recognize \relates, \related, \relatesonly, \relatedonly
so that -Wdocumentation-unknown-command does not warn on these commands. Fixes PR16092. llvm-svn: 184676
-rw-r--r--clang/include/clang/AST/CommentCommands.td5
-rw-r--r--clang/test/Sema/warn-documentation.cpp19
2 files changed, 24 insertions, 0 deletions
diff --git a/clang/include/clang/AST/CommentCommands.td b/clang/include/clang/AST/CommentCommands.td
index 8c88494e9ae..56944add2ab 100644
--- a/clang/include/clang/AST/CommentCommands.td
+++ b/clang/include/clang/AST/CommentCommands.td
@@ -200,6 +200,11 @@ def Mainpage : VerbatimLineCommand<"mainpage">;
def Subpage : VerbatimLineCommand<"subpage">;
def Ref : VerbatimLineCommand<"ref">;
+def Relates : VerbatimLineCommand<"relates">;
+def Related : VerbatimLineCommand<"related">;
+def RelatesAlso : VerbatimLineCommand<"relatesalso">;
+def RelatedAlso : VerbatimLineCommand<"relatedalso">;
+
//===----------------------------------------------------------------------===//
// DeclarationVerbatimLineCommand
//===----------------------------------------------------------------------===//
diff --git a/clang/test/Sema/warn-documentation.cpp b/clang/test/Sema/warn-documentation.cpp
index 8eb21a60a06..21b8dcb0d24 100644
--- a/clang/test/Sema/warn-documentation.cpp
+++ b/clang/test/Sema/warn-documentation.cpp
@@ -588,6 +588,25 @@ int test4; ///< \brief
///< \author Aaa
+class TestRelates {};
+
+/// \relates TestRelates
+/// \brief Aaa
+void test_relates_1();
+
+/// \related TestRelates
+/// \brief Aaa
+void test_relates_2();
+
+/// \relatesalso TestRelates
+/// \brief Aaa
+void test_relates_3();
+
+/// \relatedalso TestRelates
+/// \brief Aaa
+void test_relates_4();
+
+
// Check that we attach the comment to the declaration during parsing in the
// following cases. The test is based on the fact that we don't parse
// documentation comments that are not attached to anything.
OpenPOWER on IntegriCloud