blob: 31c9313cf53a96c7aa7386140d1605017d04f0fd [file] [log] [blame]
Richard Smith0f561182016-01-06 21:54:29 +00001// RUN: %clang_cc1 -verify %s
2
3struct X {
4 int a; // expected-note {{previous}}
5 void b(); // expected-note {{previous}}
6 struct c; // expected-note {{previous}}
7 typedef int d; // expected-note {{previous}}
8
9 union {
10 int a; // expected-error {{member of anonymous union redeclares}}
11 int b; // expected-error {{member of anonymous union redeclares}}
12 int c; // expected-error {{member of anonymous union redeclares}}
13 int d; // expected-error {{member of anonymous union redeclares}}
14 int e; // expected-note {{previous}}
15 int f; // expected-note {{previous}}
Richard Smith9f951822016-01-06 22:49:11 +000016 int g; // expected-note {{previous}}
Richard Smith0f561182016-01-06 21:54:29 +000017 int h; // expected-note {{previous}}
18 };
19
20 int e; // expected-error {{duplicate member}}
21 void f(); // expected-error {{redefinition}}
Richard Smith9f951822016-01-06 22:49:11 +000022 struct g; // expected-error {{redefinition}}
Richard Smith0f561182016-01-06 21:54:29 +000023 typedef int h; // expected-error {{redefinition}}
24};