blob: c59c4a550d7a25e7f53d01d186384c16e9b6bfa5 [file] [log] [blame]
Alp Toker6cfe4122014-05-28 12:20:23 +00001// RUN: %clang_cc1 -fexceptions -fcxx-exceptions -fsyntax-only -verify %s
Daniel Dunbare16b80c2009-06-15 17:18:42 +00002
3class C {
4public:
5 C(int a, int b);
6};
7
8C::C(int a, // expected-note {{previous definition}}
9 int b) // expected-note {{previous definition}}
10try {
11 int c;
Daniel Dunbare16b80c2009-06-15 17:18:42 +000012} catch (int a) { // expected-error {{redefinition of 'a'}}
13 int b; // expected-error {{redefinition of 'b'}}
Douglas Gregor3e5e9602009-11-25 19:25:39 +000014 ++c; // expected-error {{use of undeclared identifier 'c'}}
Daniel Dunbare16b80c2009-06-15 17:18:42 +000015}
Aaron Ballman9ef622e2014-06-02 13:10:07 +000016
17void f(int i) {
18 struct S {
19 void g() try {} catch (int i) {}; // OK
20 };
21}