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