summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/warn-documentation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Attaching comments to redeclarations: fix wrong assumptionsDmitri Gribenko2012-08-141-7/+37
| | | | | | | | | | | | | | | | | | The reason for the recent fallout for "attaching comments to any redeclaration" change are two false assumptions: (1) a RawComment is attached to a single decl (not true for 'typedef struct X *Y' where we want the comment to be attached to both X and Y); (2) the whole redeclaration chain has only a single comment (obviously false, the user can put a separate comment for each redeclaration). To fix (1) I revert the part of the recent change where a 'Decl*' member was introduced to RawComment. Now ASTContext has a separate DenseMap for mapping 'Decl*' to 'FullComment*'. To fix (2) I just removed the test with this assumption. We might not parse every comment in redecl chain if we already parsed at least one. llvm-svn: 161878
* When looking for the comment associated with a declaration, adjust theDouglas Gregor2012-08-131-0/+16
| | | | | | | | 'templated' declaration for a function or class template to refer to the function or class template itself, to which the documentation will be attached. Fixes PR13593. llvm-svn: 161762
* libclang API for comment-to-xml conversion.Dmitri Gribenko2012-08-071-0/+4
| | | | | | | | | | | | The implementation also includes a Relax NG schema and tests for the schema itself. The schema is used in c-index-test to verify that XML documents we produce are valid. In order to do the validation, we add an optional libxml2 dependency for c-index-test. Credits for CMake part go to Doug Gregor. Credits for Autoconf part go to Eric Christopher. Thanks! llvm-svn: 161431
* Comment diagnostics: warn on duplicate \brief and \return commands.Dmitri Gribenko2012-08-061-52/+110
| | | | | | | | | | Doxygen manual claims that multiple \brief or \returns commands will be merged together, but actual behavior is different (second \brief command becomes a part of a discussion, second \returns becomes a "Returns: blah" paragraph on its own). Anyway, it seems to be a bad idea to use multiple \brief or \returns commands in a single command. llvm-svn: 161325
* Comment diagnostics: \return in void function: specialize diagnostic text forDmitri Gribenko2012-08-061-11/+11
| | | | | | ObjC methods. llvm-svn: 161324
* Comment diagnostics: warn if \returns is used in a non-function comment or ifDmitri Gribenko2012-08-031-0/+78
| | | | | | the function returns void. llvm-svn: 161261
* Comments: handle template paramter documentation in alias-declarationDmitri Gribenko2012-08-021-0/+12
| | | | | | templates. llvm-svn: 161215
* Attaching comments to declarations: handle using-declaration.Dmitri Gribenko2012-08-021-17/+26
| | | | llvm-svn: 161211
* Comment parsing: add support for \tparam command on all levels.Dmitri Gribenko2012-07-311-2/+189
| | | | | | | | | | The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this breaks libclang binary compatibility, but should not be a problem since API is so new. This also fixes PR13372 as a side-effect. llvm-svn: 161087
* Comment parser: don't crash on a completely empty \param followed by a blockDmitri Gribenko2012-07-301-0/+6
| | | | | | command llvm-svn: 160975
* Comment parsing tests: fix testDmitri Gribenko2012-07-241-1/+1
| | | | llvm-svn: 160700
* Comment diagnostics tests: add a function with zero arguments, for completeness.Dmitri Gribenko2012-07-241-6/+10
| | | | llvm-svn: 160697
* Comment diagnostics: add warning for multiple \param commands with duplicateDmitri Gribenko2012-07-241-0/+12
| | | | | | parameter names. llvm-svn: 160696
* Fix PR13411: Comment parsing: failed assertion on unterminated verbatim block.Dmitri Gribenko2012-07-201-0/+6
| | | | | | | | | | The assertion was wrong in case we have a verbatim block without a closing command. Also add tests for closing command name in a verbatim block, since now it can be empty in such cases. llvm-svn: 160568
* Fix ParagraphComment::isWhitespace(): a paragraph without a non-whitespaceDmitri Gribenko2012-07-191-0/+3
| | | | | | | TextComment node was considered whitespace even if it contained other child nodes. llvm-svn: 160474
* Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML ↵Dmitri Gribenko2012-07-131-14/+14
| | | | | | start tags' and 'HTML close tags' to 'HTML end tags' according to HTML spec. llvm-svn: 160153
* Make concepts of optional and forbidden end tags separate. Thanks Jordan ↵Dmitri Gribenko2012-07-121-0/+3
| | | | | | for pointing this! llvm-svn: 160149
* Enable comment parsing and semantic analysis to emit diagnostics. A fewDmitri Gribenko2012-07-111-0/+272
diagnostics implemented -- see testcases. I created a new TableGen file for comment diagnostics, DiagnosticCommentKinds.td, because comment diagnostics don't logically fit into AST diagnostics file. But I don't feel strongly about it. This also implements support for self-closing HTML tags in comment lexer and parser (for example, <br />). In order to issue precise diagnostics CommentSema needs to know the declaration the comment is attached to. There is no easy way to find a decl by comment, so we match comments and decls in lockstep: after parsing one declgroup we check if we have any new, not yet attached comments. If we do -- then we do the usual comment-finding process. It is interesting that this automatically handles trailing comments. We pick up not only comments that precede the declaration, but also comments that *follow* the declaration -- thanks to the lookahead in the lexer: after parsing the declgroup we've consumed the semicolon and looked ahead through comments. Added -Wdocumentation-html flag for semantic HTML errors to allow the user to disable only HTML warnings (but not HTML parse errors, which we emit as warnings in -Wdocumentation). llvm-svn: 160078
OpenPOWER on IntegriCloud