1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2 // { dg-options "-fexceptions" }
5 extern "C" int printf(const char *,...);
11 LIST() { nitems = 16; items = new T[nitems]; };
13 LIST(int u) { nitems = u; items = new T[nitems]; };
15 T& operator[](int i) const {
20 T* newlist = new T[n];
26 while (i--) *dst++ = *src++;
32 if (items) delete[] items;
42 int main(int argc, char **argv) {
46 printf("Start dumping initial 10 item list\n");
47 for (i = 0; i < 10 ; i++) {
49 printf("%d\n", mylist[i]);
52 printf("Growing list to 20\n");
55 printf("Start dumping grown 20 item list\n");
56 for (i = 0; i < 20; i++) {
58 printf("%d\n", mylist[i]);