blob: 763cfdab28da23091526d95e94f6f82b7bb3c0a1 [file] [log] [blame]
Argyrios Kyrtzidis22cd9ac2012-09-10 22:04:22 +00001// RUN: %clang_cc1 -cc1 %s -include %s
2// RUN: %clang_cc1 -cc1 %s -emit-pch -o %t.pch
3// RUN: %clang_cc1 -cc1 %s -include-pch %t.pch
4
5// rdar://12239321 Make sure we don't emit a bogus
6// error: field designator 'e' does not refer to a non-static data member
7
8#ifndef HEADER
9#define HEADER
10//===----------------------------------------------------------------------===//
11
12struct U {
13 union {
14 struct {
15 int e;
16 int f;
17 };
18
19 int a;
20 };
21};
22
23//===----------------------------------------------------------------------===//
24#else
25#if !defined(HEADER)
26# error Header inclusion order messed up
27#endif
28//===----------------------------------------------------------------------===//
29
30void bar() {
31 static const struct U plan = { .e = 1 };
32}
33
34//===----------------------------------------------------------------------===//
35#endif