should be fine to use it without further explanations in the attached
paragraph, so the warning about empty paragraph was turned off for it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163836
91177308-0d34-0410-b5e6-
96231b3b80d8
/// a template parameter (\\tparam or an alias).
unsigned IsTParamCommand : 1;
+ /// True if we don't want to warn about this command being passed an empty
+ /// paragraph. Meaningful only for block commands.
+ unsigned IsEmptyParagraphAllowed : 1;
+
/// \brief True if this command is a verbatim-like block command.
///
/// A verbatim-like block command eats every character (except line starting
bit IsParamCommand = 0;
bit IsTParamCommand = 0;
+ bit IsEmptyParagraphAllowed = 0;
+
bit IsVerbatimBlockCommand = 0;
bit IsVerbatimBlockEndCommand = 0;
bit IsVerbatimLineCommand = 0;
// HeaderDoc
def Templatefield : BlockCommand<"templatefield"> { let IsTParamCommand = 1; }
+def Deprecated : BlockCommand<"deprecated"> { let IsEmptyParagraphAllowed = 1; }
+
def Author : BlockCommand<"author">;
def Authors : BlockCommand<"authors">;
def Bug : BlockCommand<"bug">;
}
void Sema::checkBlockCommandEmptyParagraph(BlockCommandComment *Command) {
+ if (Traits.getCommandInfo(Command->getCommandID())->IsEmptyParagraphAllowed)
+ return;
+
ParagraphComment *Paragraph = Command->getParagraph();
if (Paragraph->isWhitespace()) {
SourceLocation DiagLoc;
template<typename T>
using test_tparam15 = test_tparam13<T, int>;
+
+/// Aaa
+/// \deprecated Bbb
+void test_deprecated_1(int a);
+
+// We don't want \deprecated to warn about empty paragraph. It is fine to use
+// \deprecated by itself without explanations.
+
+/// Aaa
+/// \deprecated
+void test_deprecated_2(int a);
+
+
// no-warning
/// \returns Aaa
int test_returns_right_decl_1(int);
<< Tag.getValueAsBit("IsReturnsCommand") << ", "
<< Tag.getValueAsBit("IsParamCommand") << ", "
<< Tag.getValueAsBit("IsTParamCommand") << ", "
+ << Tag.getValueAsBit("IsEmptyParagraphAllowed") << ", "
<< Tag.getValueAsBit("IsVerbatimBlockCommand") << ", "
<< Tag.getValueAsBit("IsVerbatimBlockEndCommand") << ", "
<< Tag.getValueAsBit("IsVerbatimLineCommand") << ", "