MicrosoftExtensions.c revision 842e7a22c6a0fbf0ccdb4bb9308d92ca9e9621f6
1// RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions
2
3
4struct A
5{
6   int a[];  /* expected-warning {{flexible array member 'a' in otherwise empty struct is a Microsoft extension}} */
7};
8
9struct C {
10   int l;
11   union {
12       int c1[];   /* expected-warning {{flexible array member 'c1' in a union is a Microsoft extension}}  */
13       char c2[];  /* expected-warning {{flexible array member 'c2' in a union is a Microsoft extension}} */
14   };
15};
16
17
18struct D {
19   int l;
20   int D[];
21};
22
23
24enum ENUM1; // expected-warning {{forward references to 'enum' types are a Microsoft extension}}
25enum ENUM1 var1 = 3;
26enum ENUM1* var2 = 0;
27
28
29enum ENUM2 {
30	ENUM2_a = (enum ENUM2) 4,
31	ENUM2_b = 0x9FFFFFFF, // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
32	ENUM2_c = 0x100000000 // expected-warning {{enumerator value is not representable in the underlying type 'int'}}
33};
34