brintos

brintos / llvm-project-archived public Read only

0
0
Text · 822 B · 7d969f1 Raw
36 lines · c
1// RUN: %clang_cc1 %s -include %s2// RUN: %clang_cc1 %s -emit-pch -o %t.pch3// RUN: %clang_cc1 %s -include-pch %t.pch4 5// Make sure we don't emit a bogus6//     error: field designator 'e' does not refer to a non-static data member7 8#ifndef HEADER9#define HEADER10//===----------------------------------------------------------------------===//11 12struct U {13  union {14    struct {15      int e;16      int f;17    };18 19    int a;20  };21};22 23//===----------------------------------------------------------------------===//24#else25#if !defined(HEADER)26# error Header inclusion order messed up27#endif28//===----------------------------------------------------------------------===//29 30void bar(void) {31  static const struct U plan = { .e = 1 };32}33 34//===----------------------------------------------------------------------===//35#endif36