annotate gcc/testsuite/g++.dg/ext/anon-struct3.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-options "-fms-extensions" } */
kono
parents:
diff changeset
2 /* Verify that enabling Microsoft mode doesn't twist C++ as much as
kono
parents:
diff changeset
3 their corresponding C extensions. Checked vs
kono
parents:
diff changeset
4 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
kono
parents:
diff changeset
5 */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct A { char a; };
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 struct B {
kono
parents:
diff changeset
10 struct A; /* forward decl of B::A. */
kono
parents:
diff changeset
11 char b;
kono
parents:
diff changeset
12 };
kono
parents:
diff changeset
13 char testB[sizeof(B) == sizeof(A) ? 1 : -1];
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 struct C {
kono
parents:
diff changeset
16 struct D { char d; }; /* decl of C::D. */
kono
parents:
diff changeset
17 char c;
kono
parents:
diff changeset
18 };
kono
parents:
diff changeset
19 char testC[sizeof(C) == sizeof(A) ? 1 : -1];
kono
parents:
diff changeset
20 char testD[sizeof(C::D) == sizeof(A) ? 1 : -1];
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 struct E {
kono
parents:
diff changeset
23 struct { char z; };
kono
parents:
diff changeset
24 char e;
kono
parents:
diff changeset
25 };
kono
parents:
diff changeset
26 char testE[sizeof(E) == 2 * sizeof(A) ? 1 : -1];
kono
parents:
diff changeset
27 char testEz[sizeof( ((E *)0)->z )];
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 typedef struct A typedef_A;
kono
parents:
diff changeset
30 struct F {
kono
parents:
diff changeset
31 typedef_A; /* { dg-error "does not declare anything" } */
kono
parents:
diff changeset
32 char f;
kono
parents:
diff changeset
33 };
kono
parents:
diff changeset
34 char testF[sizeof(F) == sizeof(A) ? 1 : -1];