Debian Codegraph @

gcc/testsuite/g++.dg/ext/anon-struct3.C

raw
1 /* { dg-options "-fms-extensions" } */
2 /* Verify that enabling Microsoft mode doesn't twist C++ as much as
3 their corresponding C extensions. Checked vs
4 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
5 */
6
7 struct A { char a; };
8
9 struct B {
10 struct A; /* forward decl of B::A. */
11 char b;
12 };
13 char testB[sizeof(B) == sizeof(A) ? 1 : -1];
14
15 struct C {
16 struct D { char d; }; /* decl of C::D. */
17 char c;
18 };
19 char testC[sizeof(C) == sizeof(A) ? 1 : -1];
20 char testD[sizeof(C::D) == sizeof(A) ? 1 : -1];
21
22 struct E {
23 struct { char z; };
24 char e;
25 };
26 char testE[sizeof(E) == 2 * sizeof(A) ? 1 : -1];
27 char testEz[sizeof( ((E *)0)->z )];
28
29 typedef struct A typedef_A;
30 struct F {
31 typedef_A; /* { dg-error "does not declare anything" } */
32 char f;
33 };
34 char testF[sizeof(F) == sizeof(A) ? 1 : -1];