Richard Smith | 0f56118 | 2016-01-06 21:54:29 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -verify %s |
| 2 | |
| 3 | struct 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 Smith | 9f95182 | 2016-01-06 22:49:11 +0000 | [diff] [blame] | 16 | int g; // expected-note {{previous}} |
Richard Smith | 0f56118 | 2016-01-06 21:54:29 +0000 | [diff] [blame] | 17 | int h; // expected-note {{previous}} |
| 18 | }; |
| 19 | |
| 20 | int e; // expected-error {{duplicate member}} |
| 21 | void f(); // expected-error {{redefinition}} |
Richard Smith | 9f95182 | 2016-01-06 22:49:11 +0000 | [diff] [blame] | 22 | struct g; // expected-error {{redefinition}} |
Richard Smith | 0f56118 | 2016-01-06 21:54:29 +0000 | [diff] [blame] | 23 | typedef int h; // expected-error {{redefinition}} |
| 24 | }; |