summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/warn-documentation.m
Commit message (Collapse)AuthorAgeFilesLines
* [Wdocumentation] fixes an assertion failure with typedefed function and ↵Dmitri Gribenko2019-09-021-0/+8
| | | | | | | | | | | | | | | | | | | | | 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
* Fix typos in clangAlexander Kornienko2018-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* -Wdocumentation should allow '...' params in variadic function type aliasesAlex Lorenz2017-10-061-0/+11
| | | | | | rdar://34811344 llvm-svn: 315103
* -Wdocumentation should not check the @returns command for Objective-CAlex Lorenz2017-04-261-0/+8
| | | | | | | | | | | | | | | | function/block pointer properties The commit r300981 allowed @param/@return commands for function/block pointer property declarations. This meant that -Wdocumentation started warning about @return that was used to document properties whose function/block type returned void. However, prior to that commit, we allowed @return for all property declarations, because it can be used to document the value that's returned by the property getter. This commit restores the previous behaviour: now the @return command can be used to document all properties without warnings. rdar://24978538 llvm-svn: 301402
* [AST] Look through attribute type locs when searching for function typeAlex Lorenz2017-04-261-1/+1
| | | | | | | | | | | | loc Prior to this commit -Wdocumentation crashed when checking the @returns command for declarations whose function/block pointer type included an attribute like _Nullable. rdar://31818195 llvm-svn: 301400
* [PR32667] -Wdocumentation should allow @param/@returns for fields/variablesAlex Lorenz2017-04-211-0/+62
| | | | | | | | | | | | | | | | 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
* Comment parsing: allow "\param ..." to describe variadic argumentsDmitri Gribenko2013-06-241-0/+14
| | | | | | | | Original patch by Fariborz Jahanian; extended by me. Fixes rdar://14124644 llvm-svn: 184688
* Revert r184249, "doc. parsing: Allow parameter name "..." for variadic ↵NAKAMURA Takumi2013-06-191-19/+0
| | | | | | | | | | | functions/methods." It crashes in the case; /// Without any "param"s in the description. int printf(const char *format, ...); llvm-svn: 184283
* doc. parsing: Allow parameter name "..." for variadic functions/methods.Fariborz Jahanian2013-06-181-0/+19
| | | | | | // rdar://14124644 llvm-svn: 184249
* Fix potential infinite loop when iterating over redeclarations of an ↵Argyrios Kyrtzidis2013-05-301-0/+12
| | | | | | | | | | | ObjMethodDecl, resulting from invalid code. Check for invalid decls in ObjCMethodDecl::getNextRedeclaration(); otherwise if we start from an invalid redeclaration of an @implementation we would move to the @interface and not reach the original declaration again. Fixes rdar://14024851 llvm-svn: 182951
* doc. parsing. HeaderDoc documentaton allows use ofFariborz Jahanian2013-05-201-0/+6
| | | | | | | @class command on an @interface declaration. Turn off the warning for this case. // rdar://13927330 llvm-svn: 182334
* Objective-C error recovery. This patch makes a quickFariborz Jahanian2013-05-131-0/+21
| | | | | | | | | recovery form duplicate method definition error thus preventing doc parsing to loop trying to find comment for the invalid redefinition in a previous declaration. // rdar://13836387 llvm-svn: 181710
* [doc parsing]: make single character command imposturesFariborz Jahanian2013-05-091-0/+4
| | | | | | warn in pedantic mode. llvm-svn: 181523
* [Doc parsing] Provide diagnostics for unknown documentation Fariborz Jahanian2013-05-031-0/+1
| | | | | | commands. // rdar://12381408 llvm-svn: 181071
* documentation comment parsing. Added couple of Fariborz Jahanian2013-03-181-0/+14
| | | | | | | | top-level HeaderDoc tags @functiongroup and @methodgroup to doc. tags recognized. // rdar://12379114 llvm-svn: 177358
* HeaderDoc: Support more of HeaderDoc documentation Fariborz Jahanian2013-03-071-0/+52
| | | | | | | | commands; top level tags such as @interface and their 2nd level tags such as @coclass, etc. // rdar://12379114 llvm-svn: 176667
* Spell Objective-C correctly.Fariborz Jahanian2013-03-061-1/+1
| | | | llvm-svn: 176563
* say objective-C in the warning and streamlineFariborz Jahanian2013-03-061-1/+1
| | | | | | several diagnostics into one. // rdar://13094352 llvm-svn: 176560
* doc. parsing. Improve on diagnostics on my last patch.Fariborz Jahanian2013-03-051-1/+1
| | | | | | // rdar://13094352. llvm-svn: 176525
* doc parsing. Add @method and @callback forFariborz Jahanian2013-03-051-0/+8
| | | | | | | checkings and few other refactoring/cleanup. // rdar://13094352. llvm-svn: 176509
* Comment diagnostics: for unresolved parameters, do not suggest parameter fixitDmitri Gribenko2012-08-241-2/+2
| | | | | | | | 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-1/+7
| | | | | | | | use \param and \returns in documentation. Fixes PR13533. llvm-svn: 162507
* Comment diagnostics: warn on duplicate \brief and \return commands.Dmitri Gribenko2012-08-061-12/+12
| | | | | | | | | | 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-0/+9
| | | | | | ObjC methods. llvm-svn: 161324
* Turn -Wobjc-root-class on by default. <rdar://problem/11203649>.Ted Kremenek2012-07-251-1/+1
| | | | llvm-svn: 160707
* Attaching comments to declarations during parsing: handle more Objective-C ↵Dmitri Gribenko2012-07-131-5/+65
| | | | | | declarations. llvm-svn: 160156
* Enable comment parsing and semantic analysis to emit diagnostics. A fewDmitri Gribenko2012-07-111-0/+24
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