From f23df1b2a323094e5a6869ef085f100fd065bc0d Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Thu, 5 Mar 2020 19:24:28 +0100 Subject: [PATCH] Comment parsing: Treat \ref as inline command Summary: It's basically Doxygen's version of a link and can happen anywhere inside of a paragraph. Fixes a bogus warning about empty paragraphs when a parameter description starts with a link. Reviewers: gribozavr2 Reviewed By: gribozavr2 Differential Revision: https://reviews.llvm.org/D75632 --- clang/include/clang/AST/CommentCommands.td | 2 +- clang/test/Sema/warn-documentation.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/AST/CommentCommands.td b/clang/include/clang/AST/CommentCommands.td index d387df7..fbbfc9f7e 100644 --- a/clang/include/clang/AST/CommentCommands.td +++ b/clang/include/clang/AST/CommentCommands.td @@ -87,6 +87,7 @@ def P : InlineCommand<"p">; def A : InlineCommand<"a">; def E : InlineCommand<"e">; def Em : InlineCommand<"em">; +def Ref : InlineCommand<"ref">; def Anchor : InlineCommand<"anchor">; //===----------------------------------------------------------------------===// @@ -205,7 +206,6 @@ def Paragraph : VerbatimLineCommand<"paragraph">; def Mainpage : VerbatimLineCommand<"mainpage">; def Subpage : VerbatimLineCommand<"subpage">; -def Ref : VerbatimLineCommand<"ref">; def Relates : VerbatimLineCommand<"relates">; def Related : VerbatimLineCommand<"related">; diff --git a/clang/test/Sema/warn-documentation.cpp b/clang/test/Sema/warn-documentation.cpp index 3091c2f..2b2a3d1 100644 --- a/clang/test/Sema/warn-documentation.cpp +++ b/clang/test/Sema/warn-documentation.cpp @@ -294,6 +294,9 @@ int test_param22(int x1, int x2, int x3); /// \retval 0 Blah blah. int test_param23(int a); +/// \param a \ref test_param23 has an empty paragraph, this doesn't. +int test_param24(int a); + //===--- // Test that we treat typedefs to some non-function types as functions for the // purposes of documentation comment parsing. -- 2.7.4