Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.ext/array4.C

raw
1 // { dg-do assemble }
2 // { dg-options "" }
3
4
5 // Copyright (C) 2000 Free Software Foundation, Inc.
6 // Contributed by Mark Mitchell 19 Mar 2000 <[email protected]>
7 // Nathan Sidwell 19 Mar 2000 <[email protected]>
8
9 // [nathan] We have a zero sized array extension, and (unfortunately) allow it
10 // to be the sole member of a struct (rather than the trailing member of a
11 // non-empty struct as C99 is/will allow). Such a type will have a size of
12 // zero, but is not incomplete.
13
14 struct A
15 {
16 int m[0];
17 };
18
19 void foo ()
20 {
21 A a;
22 }
23
24 template <class T>
25 struct S
26 {
27 int x[0];
28 };
29
30 template struct S<int>;
31