blob: 920a1d59c747a0c86f15fc93363b8e7f489071ef [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 }
19}