[cfe-commits] r145928 - in /cfe/trunk: include/clang/Basic/DiagnosticIDs.h include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Parse/Parser.h include/clang/Sema/Sema.h lib/Parse/ParseObjc.cpp lib/Sema/SemaDeclObjC.cpp test/Index/cindex-on-invalid-usrs.m test/Parser/missing-end-2.m test/Parser/missing-end-3.m test/Parser/missing-end.m test/Parser/objc-missing-impl.m test/Parser/objc-quirks.m test/SemaObjC/missing-atend-metadata.m

jahanian fjahanian at apple.com
Wed Dec 7 09:51:31 PST 2011


On Dec 6, 2011, at 9:51 AM, jahanian wrote:

> Looks good. One question below.
> On Dec 6, 2011, at 1:25 AM, Erik Verbruggen wrote:
> 
>> Author: erikjv
>> Date: Tue Dec  6 03:25:23 2011
>> New Revision: 145928
>> 
>> 
>> +void Parser::CheckNestedObjCContexts(SourceLocation AtLoc)
>> +{
>> +  Sema::ObjCContainerKind ock = Actions.getObjCContainerKind();
>> +  if (ock == Sema::OCK_None)
>> +    return;
>> +
>> +  Decl *Decl = Actions.ActOnAtEnd(getCurScope(), AtLoc);
>> +  Diag(AtLoc, diag::err_objc_missing_end)
>> +      << FixItHint::CreateInsertion(AtLoc, "@end\n");
>> +  if (Decl)
>> +    Diag(Decl->getLocStart(), diag::note_objc_container_start)
>> +        << (int) ock;
>> +  if (!PendingObjCImpDecl.empty())
>> +    PendingObjCImpDecl.pop_back();
> 
> You are assuming that a missing '@end' is for an @implementation here. 
> Is this always the case, if so, you may want to assert on oak == OCK_Implementation
> (or its category equivalent).

Above patch causes a bogus error and a crash in this test case:

@implementation I
- Meth {}
+ Cls {}
@protocol P;
@end

- Fariborz

> 
> - fariborz
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list