2 // Copyright (C) 1999 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 14 Jan 1999 <nathan@acm.org>
5 // Make sure objects with mutable members are never placed in a read only
8 // All these are POD structs, and hence do not need ctors
9 struct A { mutable int i; };
12 struct D { static A const a; };
14 // all these are static consts and hence naively suitable for a read only
15 // section. But they contain a mutable, so must be in a writable section.
16 static int const i = 0;
17 static A const a = {0};
18 static B const b = {{0}};
19 static C const c = {{{0}}};
20 static A const aa[] = {{0}};
21 static B const bb[] = {{{0}}};
22 static C const cc[] = {{{{0}}}};
37 if(!c.a[0].i) return 1;
38 if(!aa[0].i) return 1;
39 if(!bb[0].a.i) return 1;
40 if(!cc[0].a[0].i) return 1;