• Home
  • Raw
  • Download

Lines Matching refs:new

62 //--------------- test new family
64 int *p = new int;
65 …free(p); // expected-warning{{Memory allocated by 'new' should be deallocated by 'delete', not fre…
69 int *p = (int *)operator new(0);
70 …free(p); // expected-warning{{Memory allocated by operator new should be deallocated by 'delete', …
74 int *p = new int[1];
75 …free(p); // expected-warning{{Memory allocated by 'new[]' should be deallocated by 'delete[]', not…
79 int *p = new int;
80 …realloc(p, sizeof(long)); // expected-warning{{Memory allocated by 'new' should be deallocated by …
84 int *p = (int *)operator new(0);
85 …realloc(p, sizeof(long)); // expected-warning{{Memory allocated by operator new should be dealloca…
89 int *p = new int[1];
90 …realloc(p, sizeof(long)); // expected-warning{{Memory allocated by 'new[]' should be deallocated b…
94 int *p = new int;
95 …delete[] p; // expected-warning{{Memory allocated by 'new' should be deallocated by 'delete', not …
99 int *p = (int *)operator new(0);
100 …delete[] p; // expected-warning{{Memory allocated by operator new should be deallocated by 'delete…
104 int *p = new int[1];
105 …delete p; // expected-warning{{Memory allocated by 'new[]' should be deallocated by 'delete[]', no…
109 int *p = (int *)operator new[](0);
110 …delete p; // expected-warning{{Memory allocated by operator new[] should be deallocated by 'delete…
114 int *p = new int;
115 …ing{{+dataWithBytesNoCopy:length:freeWhenDone: cannot take ownership of memory allocated by 'new'}}
123 // new/delete oparators are subjects of cplusplus.NewDelete.
128 int *p1 = new int;
131 int *p2 = new int;
135 int *p3 = new int; // no-warning
153 p = new(p) int; // no-warning
177 int *p = new int;
183 int *p = new int;
185 p = new(p) int; // no-warning
197 …// expected-warning@-1 {{Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'del…
204 SimpleSmartPointer<int> a(new int);
208 SimpleSmartPointer<int> a(new int[4]);
214 SimpleSmartPointer<int> a(new int);