[cfe-commits] r64375 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.def lib/Sema/SemaStmt.cpp test/Parser/objc-try-catch-1.m test/SemaObjC/try-catch.m

steve naroff snaroff at apple.com
Thu Feb 12 09:54:14 PST 2009


On Feb 12, 2009, at 12:47 PM, Chris Lattner wrote:

>
> On Feb 12, 2009, at 7:55 AM, Steve Naroff wrote:
>
>> +Sema::ActOnObjCAtThrowStmt(SourceLocation AtLoc, ExprArg  
>> expr,Scope *CurScope) {
>>  Expr *ThrowExpr = static_cast<Expr*>(expr.release());
>>  if (!ThrowExpr) {
>>    // @throw without an expression designates a rethrow (which much  
>> occur
>> @@ -998,8 +997,7 @@
>>    if (!Context.isObjCObjectPointerType(ThrowType)) {
>>      const PointerType *PT = ThrowType->getAsPointerType();
>>      if (!PT || !PT->getPointeeType()->isVoidType())
>> -        // This should be an error, however GCC only yields a  
>> warning.
>> -        Diag(AtLoc, diag::warn_objc_throw_expects_object)
>> +        Diag(AtLoc, diag::error_objc_throw_expects_object)
>>                    << ThrowExpr->getType() << ThrowExpr- 
>> >getSourceRange();
>>    }
>>
>
> I think this should "return true;" after the error so that we don't  
> create and return an invalid AST.
>

Oops. Good catch - thanks,

snaroff

> -Chris




More information about the cfe-commits mailing list