diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-12 23:26:56 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-12 23:26:56 +0000 | 
| commit | a2ca03a908e65a472e424ba0eb66caad71093fc6 (patch) | |
| tree | 805b774838bd2f9438c8764e3ed35343f10be3c6 /clang | |
| parent | 7186f20a1b8b82d0b90950cdf37fbd8caf84a339 (diff) | |
| download | bcm5719-llvm-a2ca03a908e65a472e424ba0eb66caad71093fc6.tar.gz bcm5719-llvm-a2ca03a908e65a472e424ba0eb66caad71093fc6.zip | |
if we already know that a decl is invalid in an @catch, don't verify its type.
llvm-svn: 68925
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaObjC/exception-go-boom.m | 3 | 
2 files changed, 6 insertions, 3 deletions
| diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 1428c488471..a34fc2410e1 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -1031,6 +1031,10 @@ Sema::ActOnObjCAtCatchStmt(SourceLocation AtLoc,    // PVD == 0 implies @catch(...).    if (PVD) { +    // If we already know the decl is invalid, reject it. +    if (PVD->isInvalidDecl()) +      return StmtError(); +          if (!Context.isObjCObjectPointerType(PVD->getType()))        return StmtError(Diag(PVD->getLocation(),                          diag::err_catch_param_not_objc_type)); @@ -1038,7 +1042,7 @@ Sema::ActOnObjCAtCatchStmt(SourceLocation AtLoc,        return StmtError(Diag(PVD->getLocation(),                          diag::err_illegal_qualifiers_on_catch_parm));    } -     +    ObjCAtCatchStmt *CS = new (Context) ObjCAtCatchStmt(AtLoc, RParen,      PVD, static_cast<Stmt*>(Body.release()), CatchList);    return Owned(CatchList ? CatchList : CS); diff --git a/clang/test/SemaObjC/exception-go-boom.m b/clang/test/SemaObjC/exception-go-boom.m index 774ae7cd639..5e5f58eeb1e 100644 --- a/clang/test/SemaObjC/exception-go-boom.m +++ b/clang/test/SemaObjC/exception-go-boom.m @@ -4,8 +4,7 @@  void f0(id x) {    @try {    } @catch (NSException *x) { // \ -         expected-error{{unknown type name 'NSException'}} \ -         expected-error{{@catch parameter is not a pointer to an interface type}} +         expected-error{{unknown type name 'NSException'}}    }  } | 

