r184676 - Documentation parsing: recognize \relates, \related, \relatesonly, \relatedonly
Dmitri Gribenko
gribozavr at gmail.com
Sun Jun 23 16:33:14 PDT 2013
Author: gribozavr
Date: Sun Jun 23 18:33:14 2013
New Revision: 184676
URL: http://llvm.org/viewvc/llvm-project?rev=184676&view=rev
Log:
Documentation parsing: recognize \relates, \related, \relatesonly, \relatedonly
so that -Wdocumentation-unknown-command does not warn on these commands.
Fixes PR16092.
Modified:
cfe/trunk/include/clang/AST/CommentCommands.td
cfe/trunk/test/Sema/warn-documentation.cpp
Modified: cfe/trunk/include/clang/AST/CommentCommands.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentCommands.td?rev=184676&r1=184675&r2=184676&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/CommentCommands.td (original)
+++ cfe/trunk/include/clang/AST/CommentCommands.td Sun Jun 23 18:33:14 2013
@@ -200,6 +200,11 @@ def Mainpage : VerbatimLineCommand<"main
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
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/test/Sema/warn-documentation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-documentation.cpp?rev=184676&r1=184675&r2=184676&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-documentation.cpp (original)
+++ cfe/trunk/test/Sema/warn-documentation.cpp Sun Jun 23 18:33:14 2013
@@ -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.
More information about the cfe-commits
mailing list