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