[cfe-commits] r69187 - in /cfe/tags/Apple/clang/clang/tools/clang: lib/Sema/SemaDecl.cpp test/SemaObjC/scope-check-try-catch.m
Daniel Dunbar
daniel at zuster.org
Wed Apr 15 10:52:52 PDT 2009
Author: ddunbar
Date: Wed Apr 15 12:52:50 2009
New Revision: 69187
URL: http://llvm.org/viewvc/llvm-project?rev=69187&view=rev
Log:
Back r69073 out of clang-9 (2nd attempt)
Removed:
cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/scope-check-try-catch.m
Modified:
cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaDecl.cpp
Modified: cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaDecl.cpp?rev=69187&r1=69186&r2=69187&view=diff
==============================================================================
--- cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaDecl.cpp (original)
+++ cfe/tags/Apple/clang/clang/tools/clang/lib/Sema/SemaDecl.cpp Wed Apr 15 12:52:50 2009
@@ -2897,22 +2897,21 @@
}
static bool StatementCreatesScope(Stmt* S) {
+ DeclStmt *DS = dyn_cast<DeclStmt>(S);
+ if (DS == 0) return false;
- if (DeclStmt *DS = dyn_cast<DeclStmt>(S)) {
- for (DeclStmt::decl_iterator I = DS->decl_begin(), E = DS->decl_end();
- I != E; ++I) {
- if (VarDecl *D = dyn_cast<VarDecl>(*I)) {
- if (D->getType()->isVariablyModifiedType() ||
- D->hasAttr<CleanupAttr>())
- return true;
- } else if (TypedefDecl *D = dyn_cast<TypedefDecl>(*I)) {
- if (D->getUnderlyingType()->isVariablyModifiedType())
- return true;
- }
+ for (DeclStmt::decl_iterator I = DS->decl_begin(), E = DS->decl_end();
+ I != E; ++I) {
+ if (VarDecl *D = dyn_cast<VarDecl>(*I)) {
+ if (D->getType()->isVariablyModifiedType() ||
+ D->hasAttr<CleanupAttr>())
+ return true;
+ } else if (TypedefDecl *D = dyn_cast<TypedefDecl>(*I)) {
+ if (D->getUnderlyingType()->isVariablyModifiedType())
+ return true;
}
- } else if (isa<ObjCAtTryStmt>(S)) {
- return true;
}
+
return false;
}
Removed: cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/scope-check-try-catch.m
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/scope-check-try-catch.m?rev=69186&view=auto
==============================================================================
--- cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/scope-check-try-catch.m (original)
+++ cfe/tags/Apple/clang/clang/tools/clang/test/SemaObjC/scope-check-try-catch.m (removed)
@@ -1,18 +0,0 @@
-// RUN: clang-cc -fsyntax-only -verify %s
-
- at class A, B, C;
-
-void f() {
- goto L; // expected-error{{illegal jump}}
- goto L2; // expected-error{{illegal jump}}
- goto L3; // expected-error{{illegal jump}}
- @try {
-L: ;
- } @catch (A *x) {
-L2: ;
- } @catch (B *x) {
- } @catch (C *c) {
- } @finally {
-L3: ;
- }
-}
More information about the cfe-commits
mailing list