On Feb 11, 2009, at 9:45 AM, Steve Naroff wrote:
> Log:
> Fix <rdar://problem/6206858> [sema] type check @throw statements.
>

Thanks!

> +Sema::ActOnObjCAtThrowStmt(SourceLocation AtLoc, ExprArg expr) {
> +  Expr *ThrowExpr = static_cast<Expr*>(expr.release());
> +  if (!ThrowExpr) {
> +    // FIXME: verify the 'rethrow' is within a @catch block
> +  } else {
> +    QualType ThrowType = ThrowExpr->getType();
> +    // Make sure the expression type is an ObjC pointer or "void *".
> +    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)
> +                    << ThrowExpr->getType() << ThrowExpr- 
> >getSourceRange();


Shouldn't this reject aggregates with an error?

-Chris
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to