[cfe-commits] [PATCH] Introduce diagnostics into comment parsing and semantic analysis
jordan_rose at apple.com
Wed Jul 11 16:58:15 PDT 2012
On Jul 11, 2012, at 14:39 , Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> + if (!ThisDecl || ThisDecl->getKind() != Decl::Function)
>> + Diag(Command->getLocation(),
>> + diag::warn_doc_param_not_attached_to_a_function_decl);
>> This test is wrong; not only will it not catch ObjCMethodDecls (as Doug already mentioned), but it doesn't work for any subclasses of FunctionDecl either. You'll need to use isa<FunctionDecl> || isa<ObjCMethodDecl> to properly handle subclasses.
>> (ObjCMethodDecl doesn't have any subclasses right now, so if you really don't want to include DeclObjC.h you can get away with using getKind() for that one.)
> Done, but please look at the tests (test/Sema/warn-documentation.m).
> Anything else worth adding?
Seems reasonable to me, at least for now. When you start hooking up links and \sa we'll need more test cases here, of course.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits