Chandler Carruth | a64aedb | 2010-10-06 06:50:05 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions |
| 2 | |
| 3 | |
| 4 | struct A |
| 5 | { |
| 6 | int a[]; /* expected-warning {{flexible array member 'a' in otherwise empty struct is a Microsoft extension}} */ |
| 7 | }; |
| 8 | |
| 9 | struct 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 | |
| 18 | struct D { |
| 19 | int l; |
| 20 | int D[]; |
| 21 | }; |
Francois Pichet | a310806 | 2010-10-18 15:01:13 +0000 | [diff] [blame^] | 22 | |
| 23 | |
| 24 | enum ENUM1; // expected-warning {{forward references to 'enum' types are a Microsoft extension}} |
| 25 | enum ENUM1 var1 = 3; |
| 26 | enum ENUM1* var2 = 0; |
| 27 | |
| 28 | |
| 29 | enum 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 | }; |