xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/catch-stmt.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -verify -fobjc-exceptions %s
2*f4a2713aSLionel Sambuc@interface A @end
3*f4a2713aSLionel Sambuc@protocol P;
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambucvoid f() {
6*f4a2713aSLionel Sambuc  @try {
7*f4a2713aSLionel Sambuc  } @catch (void a) { // expected-error{{@catch parameter is not a pointer to an interface type}}
8*f4a2713aSLionel Sambuc  } @catch (int) { // expected-error{{@catch parameter is not a pointer to an interface type}}
9*f4a2713aSLionel Sambuc  } @catch (int *b) { // expected-error{{@catch parameter is not a pointer to an interface type}}
10*f4a2713aSLionel Sambuc  } @catch (id <P> c) { // expected-error{{illegal qualifiers on @catch parameter}}
11*f4a2713aSLionel Sambuc  } @catch(A* a) { }
12*f4a2713aSLionel Sambuc}
13*f4a2713aSLionel Sambuc
14