diff options
author | Reid Kleckner <rnk@google.com> | 2018-10-02 22:23:27 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-10-02 22:23:27 +0000 |
commit | c6fbfd84adf10b3f0f19cd8b4d3e6f586a78207a (patch) | |
tree | 3ebde3212c45112504791251df7b553f99ebf71f | |
parent | b2486f118dcc84fb0c80ac738cbaf166d9669772 (diff) | |
download | bcm5719-llvm-c6fbfd84adf10b3f0f19cd8b4d3e6f586a78207a.tar.gz bcm5719-llvm-c6fbfd84adf10b3f0f19cd8b4d3e6f586a78207a.zip |
Remove spurious assertion in -Wdocumentation
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
llvm-svn: 343641
-rw-r--r-- | clang/lib/AST/CommentParser.cpp | 1 | ||||
-rw-r--r-- | clang/test/Sema/warn-documentation.cpp | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/AST/CommentParser.cpp b/clang/lib/AST/CommentParser.cpp index c1c04239f58..7f70b95e981 100644 --- a/clang/lib/AST/CommentParser.cpp +++ b/clang/lib/AST/CommentParser.cpp @@ -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: diff --git a/clang/test/Sema/warn-documentation.cpp b/clang/test/Sema/warn-documentation.cpp index 7ffaffc0784..5083f686338 100644 --- a/clang/test/Sema/warn-documentation.cpp +++ b/clang/test/Sema/warn-documentation.cpp @@ -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 { +}; |