]> granicus.if.org Git - clang/commitdiff
Remove spurious assertion in -Wdocumentation
authorReid Kleckner <rnk@google.com>
Tue, 2 Oct 2018 22:23:27 +0000 (22:23 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 2 Oct 2018 22:23:27 +0000 (22:23 +0000)
Some code in OpenCV uses interesting doxygen directives that make it so
we don't see any tokens inside a @note, despite there definitely being
non-whitespace characters there. The consistency check isn't needed.
ParagraphComment supports receiving an empty list of comments.

Fixes PR39007

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343641 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/CommentParser.cpp
test/Sema/warn-documentation.cpp

index c1c04239f58ebf1a9a035a575da8efb44d2b81c2..7f70b95e98121b5ad68a21265b00943e70231d28 100644 (file)
@@ -558,7 +558,6 @@ BlockContentComment *Parser::parseParagraphOrBlockCommand() {
     case tok::verbatim_block_begin:
     case tok::verbatim_line_name:
     case tok::eof:
-      assert(Content.size() != 0);
       break; // Block content or EOF ahead, finish this parapgaph.
 
     case tok::unknown_command:
index 7ffaffc078494100c9dbe8cdd53cab0fae265d12..5083f686338c4b2fdff5109dd27172df79645be1 100644 (file)
@@ -1304,3 +1304,12 @@ typedef void (*VariadicFnType)(int a, ...);
  * now should work too.
  */
 using VariadicFnType2 = void (*)(int a, ...);
+
+// expected-warning@+2 {{empty paragraph passed to '@note' command}}
+/**
+@note
+\f$\texttt{mu}_{00}=\texttt{m}_{00}\f$, \f$\texttt{nu}_{00}=1\f$
+\f$\texttt{nu}_{10}=\texttt{mu}_{10}=\texttt{mu}_{01}=\texttt{mu}_{10}=0\f$
+ */
+class EmptyNoteNoCrash {
+};