Use "DeclStmt::getSolitaryDecl()" when accessing the DeclStmt of an @catch.

llvm-svn: 57215
This commit is contained in:
Ted Kremenek 2008-10-06 22:39:38 +00:00
parent 6d60a4ec19
commit 5b6f8ee7b9
1 changed files with 1 additions and 1 deletions

View File

@ -1422,7 +1422,7 @@ Stmt *RewriteObjC::RewriteObjCTryStmt(ObjCAtTryStmt *S) {
Rewrite.ReplaceText(startLoc, bodyBuf-startBuf+1,
buf.c_str(), buf.size());
} else if (DeclStmt *declStmt = dyn_cast<DeclStmt>(catchStmt)) {
QualType t = dyn_cast<ValueDecl>(declStmt->getDecl())->getType();
QualType t = dyn_cast<ValueDecl>(declStmt->getSolitaryDecl())->getType();
if (t == Context->getObjCIdType()) {
buf += "1) { ";
ReplaceText(startLoc, lParenLoc-startBuf+1, buf.c_str(), buf.size());