Alp Toker | 6cfe412 | 2014-05-28 12:20:23 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s |
Daniel Dunbar | e16b80c | 2009-06-15 17:18:42 +0000 | [diff] [blame] | 2 | |
| 3 | class C { |
| 4 | public: |
| 5 | C(int a, int b); |
| 6 | }; |
| 7 | |
| 8 | C::C(int a, // expected-note {{previous definition}} |
| 9 | int b) // expected-note {{previous definition}} |
| 10 | try { |
| 11 | int c; |
Daniel Dunbar | e16b80c | 2009-06-15 17:18:42 +0000 | [diff] [blame] | 12 | } catch (int a) { // expected-error {{redefinition of 'a'}} |
| 13 | int b; // expected-error {{redefinition of 'b'}} |
Douglas Gregor | 3e5e960 | 2009-11-25 19:25:39 +0000 | [diff] [blame] | 14 | ++c; // expected-error {{use of undeclared identifier 'c'}} |
Daniel Dunbar | e16b80c | 2009-06-15 17:18:42 +0000 | [diff] [blame] | 15 | } |
Aaron Ballman | 9ef622e | 2014-06-02 13:10:07 +0000 | [diff] [blame] | 16 | |
| 17 | void f(int i) { |
| 18 | struct S { |
| 19 | void g() try {} catch (int i) {}; // OK |
| 20 | }; |
| 21 | } |