xref: /llvm-project/clang/test/SemaObjC/no-objc-exceptions.m (revision 7deaeb2a056c1756ce6f2550d2ebb91b81b9ff29)
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3void f(void) {
4  @throw @"Hello"; // expected-error {{cannot use '@throw' with Objective-C exceptions disabled}}
5}
6
7void g(void) {
8  @try { // expected-error {{cannot use '@try' with Objective-C exceptions disabled}}
9    f();
10  } @finally {
11
12  }
13}
14