summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/warn-documentation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Wdocumentation] Implement \anchorMark de Wever2019-12-211-0/+7
| | | | Differential revision: https://reviews.llvm.org/D69223
* [Wdocumentation] Use C2x/C++14 deprecated attributeMark de Wever2019-12-101-0/+6
| | | | | | | | | This replaces the non-standard __attribute__((deprecated)) with the standard [[deprecated]] when compiling in C2x/C++14 mode. Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71141
* [Wdocumentation] Properly place deprecated attributeMark de Wever2019-12-101-0/+39
| | | | | | | | | | It is now placed before the function: - allows to replace __attribute__((deprecated)) with [[deprecated]]. - required for trailing returns. Fixes bug: https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71140
* [Wdocumentation] Use the command marker.Mark de Wever2019-12-101-2/+2
| | | | | | | | | Use the proper marker for -Wdocumentation-deprecated-sync instead of hard-coded the backslash. Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753 Differential Revision: https://reviews.llvm.org/D71139
* [AST] Attach comment in `/** doc */ typedef struct A {} B` to B as well as A.Sam McCall2019-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Semantically they're the same thing, and it's important when the underlying struct is anonymous. There doesn't seem to be a problem attaching the same comment to multiple things as it already happens with `/** doc */ int a, b;` This affects an Index test but the results look better (name present, USR points to the typedef). Fixes https://github.com/clangd/clangd/issues/189 Reviewers: kadircet, lh123 Subscribers: ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70203
* [Wdocumentation] fixes an assertion failure with typedefed function and ↵Dmitri Gribenko2019-09-021-0/+31
| | | | | | | | | | | | | | | | | | | | | block pointer Summary: The assertion happens when compiling with -Wdocumentation with variable declaration to a typedefed function pointer. I not too familiar with the ObjC syntax but first two tests assert without this patch. Fixes https://bugs.llvm.org/show_bug.cgi?id=42844 Reviewers: gribozavr Reviewed By: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66706 llvm-svn: 370677
* [Wdocumentation] improve wording of a warning messageDmitri Gribenko2019-08-251-6/+6
| | | | | | | | | | | Based on @davezarzycki remarks in D64696 improved the wording of the warning message. Differential Revision: https://reviews.llvm.org/D66700 Patch by Mark de Wever. llvm-svn: 369873
* Rudimentary support for Doxygen \retval commandStephan Bergmann2019-08-201-0/+5
| | | | | | | | | | ...so that at least a preceding \param etc. that lacks a description gets a -Wdocumentation warning (instead of erroneously treating the \retval ... text as its paragraph). Differential Revision: https://reviews.llvm.org/D66350 llvm-svn: 369345
* Adds a warning when an inline Doxygen comment has no argumentDmitri Gribenko2019-08-051-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | Summary: It warns for for comments like /** \pre \em */ where \em has no argument This warning is enabled with the -Wdocumentation option. Reviewers: gribozavr, rsmith Reviewed By: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64696 Patch by Mark de Wever. llvm-svn: 367809
* Remove spurious assertion in -WdocumentationReid Kleckner2018-10-021-0/+9
| | | | | | | | | | | 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
* -Wdocumentation should allow '...' params in variadic function type aliasesAlex Lorenz2017-10-061-0/+22
| | | | | | rdar://34811344 llvm-svn: 315103
* fix trivial typos in comments; NFCHiroshi Inoue2017-07-021-1/+1
| | | | llvm-svn: 306969
* [PR32667] -Wdocumentation should allow @param/@returns for fields/variablesAlex Lorenz2017-04-211-0/+72
| | | | | | | | | | | | | | | | that have a function/block pointer type This commit improves the -Wdocumentation warning by making sure that @param and @returns commands won't trigger warnings when used for fields, variables, or properties whose type is a function/block pointer type. The function/block pointer type must be specified directly with the declaration, and when a typedef is used the warning is still emitted. In the future we might also want to handle the std::function type as well. rdar://24978538 llvm-svn: 300981
* [Sema][Comments] Add support for TypeAliasTemplateBruno Cardoso Lopes2016-08-251-0/+32
| | | | | | | | | | | | | | | | Emit proper diagnostics when -Wdocumentation is used with constructs such as: template<typename T> using fn = int(T aaa, int ccc); Previously clang wouldn't recognize the function and complain with 'comment that is not attached to a function declaration'. Differential Revision: https://reviews.llvm.org/D23860 rdar://problem/27300695 llvm-svn: 279754
* [Sema][Comments] Support @param with c++ 'using' keywordBruno Cardoso Lopes2016-08-241-0/+63
| | | | | | | | | | | | | Give appropriate warnings with -Wdocumentation for @param comments that refer to function aliases defined with 'using'. Very similar to typedef's behavior. This does not add support for TypeAliasTemplateDecl yet. Differential Revision: https://reviews.llvm.org/D23783 rdar://problem/27300695 llvm-svn: 279662
* Comment parsing: fix an assertion failure on a verbatim block terminated ↵Dmitri Gribenko2015-04-151-0/+6
| | | | | | with "**/" llvm-svn: 235057
* Comment parsing: in the generated XML file, mark HTML that is safe to passDmitri Gribenko2014-04-221-0/+13
| | | | | | | | | | | through to the output even if the input comment comes from an untrusted source Attribute filtering is currently based on a blacklist, which right now includes all event handler attributes (they contain JavaScipt code). It should be switched to a whitelist, but going over all of the HTML5 spec requires a significant amount of time. llvm-svn: 206882
* Comment parsing: recognize \param ... on function templates with variadicDmitri Gribenko2014-03-191-0/+20
| | | | | | | | parameters Patch by Joe Ranieri. llvm-svn: 204235
* Documentation comment parsing: when checking if we have typedef to somethingDmitri Gribenko2013-12-171-0/+12
| | | | | | | that we consider a function for the purposes of checking \param and \returns, look through reference types. llvm-svn: 197530
* Documentation comment parsing: allow \param and \returns on std::function,Dmitri Gribenko2013-12-171-0/+31
| | | | | | boost::function and similar function-like objects llvm-svn: 197528
* Documentation comment parsing: rearrange tests to clarify the intent of ↵Dmitri Gribenko2013-12-171-14/+22
| | | | | | these tests llvm-svn: 197517
* Comment parsing: allow "\param ..." to describe variadic argumentsDmitri Gribenko2013-06-241-0/+16
| | | | | | | | Original patch by Fariborz Jahanian; extended by me. Fixes rdar://14124644 llvm-svn: 184688
* Documentation parsing: recognize \relates, \related, \relatesonly, \relatedonlyDmitri Gribenko2013-06-231-0/+19
| | | | | | | so that -Wdocumentation-unknown-command does not warn on these commands. Fixes PR16092. llvm-svn: 184676
* Comment parsing: followup to r184610: allow multiple \returnsDmitri Gribenko2013-06-221-4/+4
| | | | | | | | | Remove unneeded member in CommentSema, add a test for the XML schema (the schema already allowed multiple paragraphs in <ResultDiscussion>, but there were no tests for that), fix HTML generation (it is not allowed to have <p> inside <dl>). llvm-svn: 184652
* [document parsing]: Allow multiple adjacent \return and the likeFariborz Jahanian2013-06-211-4/+0
| | | | | | | commands. Render them properly in XML output. // rdar://14207725 llvm-svn: 184610
* documentation parsing: patch to make @class work forFariborz Jahanian2013-06-191-0/+44
| | | | | | | class templates; and similarly, @function works for function templates. // rdar://14124702 llvm-svn: 184329
* [Doc parsing] Provide diagnostics for unknown documentation Fariborz Jahanian2013-05-031-1/+1
| | | | | | commands. // rdar://12381408 llvm-svn: 181071
* HeaderDoc: Support more of HeaderDoc documentation Fariborz Jahanian2013-03-071-0/+28
| | | | | | | | commands; top level tags such as @interface and their 2nd level tags such as @coclass, etc. // rdar://12379114 llvm-svn: 176667
* doc. parsing. Improve on diagnostics on my last patch.Fariborz Jahanian2013-03-051-2/+2
| | | | | | // rdar://13094352. llvm-svn: 176525
* doc parsing. Add @method and @callback forFariborz Jahanian2013-03-051-10/+12
| | | | | | | checkings and few other refactoring/cleanup. // rdar://13094352. llvm-svn: 176509
* doc parsing. We want to issue a strong warning whenFariborz Jahanian2013-03-051-0/+9
| | | | | | | an @function comment is not followed by a function decl. // rdar://13094352 llvm-svn: 176468
* Comment parsing tests: move a test into a group of similar testsDmitri Gribenko2013-03-041-4/+6
| | | | llvm-svn: 176449
* [comment parsing] source fidelity for tparam command too.Fariborz Jahanian2013-03-041-0/+4
| | | | | | // rdar://13066276 llvm-svn: 176448
* warn-documentation.cpp: reorganize testsDmitri Gribenko2013-03-041-28/+18
| | | | | | Tests are ordered by command in this file. It is nice to keep it that way. llvm-svn: 176445
* comment parsing. Missed a case of referringFariborz Jahanian2013-03-041-0/+8
| | | | | | to original command in diagnostic. // rdar://13066276 llvm-svn: 176444
* comment parsing. Keep the original command format Fariborz Jahanian2013-03-011-8/+20
| | | | | | | in AST for source fidelity and use it in diagnostics to refer to the original format. // rdar://13066276 llvm-svn: 176387
* [Comment parsing] Add support for recognizingFariborz Jahanian2013-01-311-0/+8
| | | | | | | | \headerfile command and representing it in an xml document. Patch reviewed by Dmitri Gribenko. // rdar://12397511 llvm-svn: 174109
* Comment parsing: attach any tag type's documentation to its typedef if latterDmitri Gribenko2013-01-271-0/+23
| | | | | | | | does not have one of its own. // rdar://13067629 Original patch (r173586 and r173587) by Fariborz Jahanian, modified by me. llvm-svn: 173626
* Comment parsing: actually check for a block command after "\param x"Dmitri Gribenko2013-01-261-0/+28
| | | | | | This fixes PR15068. llvm-svn: 173539
* clang/test/Sema/warn-documentation.cpp: Try to fix up the testcase in r168277.NAKAMURA Takumi2012-11-181-1/+1
| | | | llvm-svn: 168278
* Documentation parsing: propely handle a lone '\endverbatim' and emit a warning.Dmitri Gribenko2012-11-181-0/+18
| | | | | | | | We actually used to assert on this. Thanks to NAKAMURA Takumi for noticing this! llvm-svn: 168277
* Comment sema: warn when comment has \deprecated but declaration does not have aDmitri Gribenko2012-09-221-2/+27
| | | | | | | | | deprecation attribute ('deprecated', 'availability' or 'unavailable'). This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it can be turned off easily while leaving other -Wdocumentation warnings on. llvm-svn: 164467
* Comment parsing: don't treat typedef to a typedef to a function as aDmitri Gribenko2012-09-151-0/+6
| | | | | | | | 'function-like' type that can be annotated with \param. Thanks to Eli Friedman for noticing! llvm-svn: 163985
* Comment parsing: support the "\invariant" command.Dmitri Gribenko2012-09-141-0/+8
| | | | llvm-svn: 163905
* Comment parsing: handle \deprecated command. It is a block command, but itDmitri Gribenko2012-09-131-0/+13
| | | | | | | should be fine to use it without further explanations in the attached paragraph, so the warning about empty paragraph was turned off for it. llvm-svn: 163836
* Comment parsing: handle non-builtin commands correctly. After semanticDmitri Gribenko2012-09-111-0/+5
| | | | | | | | | | | analysis registers a command, it becomes a "known" command for the lexer, since it has an ID. Having this freedom of choice to register a command is a good thing since BriefParser does not need this. But the parser should still invoke the correct semantic analysis method (actOnUnknownCommand) in this case. llvm-svn: 163646
* Comment diagnostics: for unresolved parameters, do not suggest parameter fixitDmitri Gribenko2012-08-241-13/+37
| | | | | | | | with parameter that is documented. Fixes PR13670, <rdar://problem/12155840>. llvm-svn: 162570
* Comment semantic analysis: treat function typedefs as functions so that one canDmitri Gribenko2012-08-241-0/+23
| | | | | | | | use \param and \returns in documentation. Fixes PR13533. llvm-svn: 162507
* Comment parsing: parse "<blah" as an HTML tag only if "blah" is a known tagDmitri Gribenko2012-08-221-2/+2
| | | | | | | | | | name. This should reduce the amount of warning false positives about bad HTML in comments when the comment author intended to put a reference to a template. This change will also enable us parse the comment as intended in these cases. Fixes part 1 of PR13374. llvm-svn: 162407
* Attaching comments to declarations: parse the comment in context of theDmitri Gribenko2012-08-161-0/+16
| | | | | | declaration it was attached to. llvm-svn: 162033
OpenPOWER on IntegriCloud