Fix two rewriter bugs with @catch.
- Support @catch(...), rather than crash:-)
- Make sure all catch bodies get rewritten. This "fix" is really a workaround until the iterator for the "try" AST is fixed. Will fix this in a separate commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46644 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Rewriter/rewrite-try-catch.m b/test/Rewriter/rewrite-try-catch.m
index b8ba45e..9cbc52b 100644
--- a/test/Rewriter/rewrite-try-catch.m
+++ b/test/Rewriter/rewrite-try-catch.m
@@ -1,8 +1,13 @@
// RUN: clang -rewrite-test %s | clang
-@interface foo @end
+@interface Foo @end
@interface GARF @end
+void foo() {
+ @try { TRY(); }
+ @catch (...) { SPLATCH(); @throw; }
+}
+
int main()
{
@@ -10,7 +15,7 @@
MYTRY();
}
-@catch (foo* localException) {
+@catch (Foo* localException) {
MYCATCH();
@throw;
}