summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/delete1.C
blob: 8528b1c65ef4f90b944437d4d4d0f97a1dc6cbff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-do assemble  }
// { dg-options "-pedantic-errors" }
// GROUPS passed operator-delete
/* ARM $5.3.4 */
void f(char *p, char *q[], const char *r, const char *s[])
{
  delete 0;             /* illegal: non-pointer */// { dg-error "" } .*expected pointer.*
  delete (char*)0;      /* no effect */
  delete p;
  delete[] q;
  delete[4] q;          /* ANSI forbids size arg */// { dg-error "" }  anachronistic .*
  delete r;             /* no longer illegal: const */
  delete[] s;
  delete[4] s;          /* ANSI forbids size arg */// { dg-error "" }  anachronistic.*
}