blob: 97dbaee10de65443c71a623b63c35c4e890891c6 [file] [log] [blame]
Sebastian Redl743c8162008-12-22 19:15:10 +00001// RUN: clang -fsyntax-only -verify %s
2
3struct A;
4
5void f()
6{
7 try {
8 } catch(int i) { // expected-note {{previous definition}}
9 int j = i;
10 int i; // expected-error {{redefinition of 'i'}}
11 } catch(float i) {
12 } catch(void v) { // expected-error {{cannot catch incomplete type 'void'}}
13 } catch(A a) { // expected-error {{cannot catch incomplete type 'struct A'}}
14 } catch(A *a) { // expected-error {{cannot catch pointer to incomplete type 'struct A'}}
15 } catch(A &a) { // expected-error {{cannot catch reference to incomplete type 'struct A'}}
16 } catch(...) {
17 int j = i; // expected-error {{use of undeclared identifier 'i'}}
18 }
Sebastian Redl237116b2008-12-22 21:35:02 +000019
20 try {
21 } catch(...) { // expected-error {{catch-all handler must come last}}
22 } catch(int) {
23 }
Sebastian Redl743c8162008-12-22 19:15:10 +000024}