2 // { dg-options "-O2 -Warray-bounds" }
3 // { dg-skip-if "" { *-*-aix* } }
8 virtual unsigned long length() const = 0;
9 virtual char get(unsigned long index) const = 0;
10 virtual void set(unsigned long index, char value) = 0;
11 virtual char& operator[] (unsigned long value) = 0;
15 template<unsigned long size> class FixedString : public String
21 virtual unsigned long length() const { return size; }
22 virtual char get(unsigned long index) const { return contents[index]; }
23 virtual void set(unsigned long index, char value) { contents[index] = value; }
24 virtual char& operator[] (unsigned long index) { return contents[index]; }
26 FixedString() { contents[0] = '\0'; } // { dg-warning "\\\[-Warray-bounds" }
29 void print_length (const String& string);
33 const FixedString<0> empty;