[cfe-commits] r88934 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Parse/Parser.h lib/Parse/ParseObjc.cpp lib/Sema/ParseAST.cpp lib/Sema/SemaDeclObjC.cpp test/Analysis/NSString.m test/Analysis/PR3991.m test/Analysis/misc-ps.m test/Analysis/pr4209.m test/Analysis/region-1.m test/CodeGenObjC/missing-atend-metadata.m test/SemaObjC/compare-qualified-id.m test/SemaObjC/method-arg-decay.m

Douglas Gregor dgregor at apple.com
Mon Nov 16 20:25:38 PST 2009


On Nov 16, 2009, at 10:57 AM, Fariborz Jahanian wrote:

> Author: fjahanian
> Date: Mon Nov 16 12:57:01 2009
> New Revision: 88934
>
> URL: http://llvm.org/viewvc/llvm-project?rev=88934&view=rev
> Log:
> Handle case of missing '@end' in implementation context
> gracefully, on par with gcc, by: Issuing a warning,
> doing final sematinc check of its definitions and generating
> its meta-data.

Cool. This is <rdar://problem/6489099>, right?

> +  DeclGroupPtrTy RetreivePendingObjCImpDecl();

Typo "Retreive" in the name of this function.

>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Mon Nov 16 12:57:01 2009
> @@ -1559,12 +1559,17 @@
>   // should be true.
>   if (!ClassDecl)
>     return;
> -
> +
>   bool isInterfaceDeclKind =
>         isa<ObjCInterfaceDecl>(ClassDecl) || isa<ObjCCategoryDecl> 
> (ClassDecl)
>          || isa<ObjCProtocolDecl>(ClassDecl);
>   bool checkIdenticalMethods = isa<ObjCImplementationDecl>(ClassDecl);
>
> +  if (!isInterfaceDeclKind && AtEndLoc.isInvalid()) {
> +    AtEndLoc = ClassDecl->getLocation();
> +    Diag(AtEndLoc, diag::warn_missing_atend);
> +  }

Is there any way for us to guess where the @end should go, with high  
probability? If so, we should add a fix-it.

	- Doug



More information about the cfe-commits mailing list