| 1 |
// { dg-do assemble } |
| 2 |
// { dg-skip-if "requires hosted libstdc++ for complex" { ! hostedlib } } |
| 3 |
// GROUPS passed operators |
| 4 |
// opr-del file |
| 5 |
// From: [email protected] (Mark Rollins) |
| 6 |
// Date: Thu, 3 Sep 1992 22:01:03 -0400 Fri, 4 Sep 1992 02:00:25 GMT |
| 7 |
// Subject: delete [size] pointer; Problem |
| 8 |
// Message-ID: <[email protected]> |
| 9 |
|
| 10 |
#include <complex> |
| 11 |
typedef std::complex<double> Complex; |
| 12 |
#include <stdio.h> |
| 13 |
|
| 14 |
class Vector { |
| 15 |
int size; |
| 16 |
Complex *v; |
| 17 |
public: |
| 18 |
Vector(int s=1) { size = s; v = new Complex[size];} |
| 19 |
~Vector() { delete [size] v;}// { dg-error "" } warning |
| 20 |
}; |
| 21 |
|
| 22 |
void foo(int s) |
| 23 |
{ |
| 24 |
Vector junk(s); |
| 25 |
} |
| 26 |
|
| 27 |
int main() |
| 28 |
{ |
| 29 |
Vector* test; |
| 30 |
for (int i=0;i<40;i++) // was 100000 |
| 31 |
foo(1000); |
| 32 |
printf ("PASS\n"); |
| 33 |
} |