| Anders Carlsson | 3320e15 | 2011-02-22 01:52:06 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only %s -verify -fobjc-exceptions |
| Andy Gibbs | c6e68da | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
| Ted Kremenek | a34ea3b | 2008-09-26 00:31:16 +0000 | [diff] [blame] | 3 | // Test case for: |
| 4 | // <rdar://problem/6248119> @finally doesn't introduce a new scope |
| 5 | |
| 6 | void f0() { |
| 7 | int i; |
| 8 | @try { |
| 9 | } @finally { |
| 10 | int i = 0; |
| 11 | } |
| 12 | } |
| Ted Kremenek | 68d2190 | 2008-09-26 17:32:47 +0000 | [diff] [blame] | 13 | |
| 14 | void f1() { |
| 15 | int i; |
| 16 | @try { |
| 17 | int i =0; |
| 18 | } @finally { |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | void f2() { |
| 23 | int i; |
| 24 | @try { |
| 25 | } @catch(id e) { |
| 26 | int i = 0; |
| 27 | } |
| 28 | } |