Lines Matching defs:new
14 // A special new, to verify that the global version isn't used.
15 void* operator new(size_t, S*); // expected-note {{candidate}}
22 void* operator new(const size_t); // expected-note 2 {{candidate}}
23 void* operator new(size_t, int*); // expected-note 3 {{candidate}}
24 void* operator new(size_t, float*); // expected-note 3 {{candidate}}
25 void* operator new(size_t, S); // expected-note 2 {{candidate}}
31 int *pi = new int;
32 float *pf = new (pi) float();
33 pi = new int(1);
34 pi = new int('c');
35 const int *pci = new const int();
36 S *ps = new S(1, 2, 3.4);
37 ps = new (pf) (S)(1, 2, 3.4);
38 S *(*paps)[2] = new S*[*pi][2];
40 ia4 *pai = new (int[3][4]);
41 pi = ::new int;
42 U *pu = new (ps) U;
43 V *pv = new (ps) V;
45 pi = new (S(1.0f, 2)) int;
47 (void)new int[true];
51 foo* f1 = new foo;
52 foo* f2 = new foo[2];
55 x* f3 = new y;
65 (void)new; // expected-error {{expected a type}}
66 (void)new 4; // expected-error {{expected a type}}
67 (void)new () int; // expected-error {{expected expression}}
68 (void)new int[1.1]; // expected-error {{array size expression must have integral or enumeration type, not 'double'}}
69 (void)new int[1][i]; // expected-error {{only the first dimension}} expected-note {{read of non-const variable 'i' is not allowed in a constant expression}}
70 (void)new (int[1][i]); // expected-error {{only the first dimension}} expected-note {{read of non-const variable 'i' is not allowed in a constant expression}}
71 (void)new (int[i]); // expected-warning {{when type is in parentheses}}
72 (void)new int(*(S*)0); // expected-error {{no viable conversion from 'S' to 'int'}}
73 (void)new int(1, 2); // expected-error {{excess elements in scalar initializer}}
74 (void)new S(1); // expected-error {{no matching constructor}}
75 (void)new S(1, 1); // expected-error {{call to constructor of 'S' is ambiguous}}
76 (void)new const int; // expected-error {{default initialization of an object of const type 'const int'}}
77 (void)new float*(ip); // expected-error {{cannot initialize a new value of type 'float *' with an lvalue of type 'int *'}}
79 (void)new int[-1]; // expected-error {{array size is negative}}
80 (void)new int[2000000000]; // expected-error {{array is too large}}
81 (void)new int[*(S*)0]; // expected-error {{array size expression must have integral or enumeration type, not 'S'}}
82 (void)::S::new int; // expected-error {{expected unqualified-id}}
83 (void)new (0, 0) int; // expected-error {{no matching function for call to 'operator new'}}
84 (void)new (0L) int; // expected-error {{call to 'operator new' is ambiguous}}
86 (void)::new ((S*)0) U; // expected-error {{no matching function for call to 'operator new'}}
88 (void)new U; // expected-error {{no matching function for call to 'operator new'}}
89 (void)new (int[]); // expected-error {{array size must be specified in new expressions}}
90 (void)new int&; // expected-error {{cannot allocate reference type 'int &' with new}}
153 static void *operator new(signed char) throw(); // expected-error {{'operator new' takes type size_t}}
154 static int operator new[] (size_t) throw(); // expected-error {{operator new[]' must return type 'void *'}}
167 new Thai(dict);
171 void* operator new(T size, int); // expected-error {{'operator new' cannot take a dependent type as first parameter; use size_t}}
216 void* operator new(size_t, void*);
220 using X12::operator new;
225 return new (g) X13();
244 new X15(); // expected-error {{calling a private constructor}}
248 namespace PR5918 { // Look for template operator new overloads.
249 struct S { template<typename T> static void* operator new(size_t, T); };
251 (void)new(0) S;
258 (void)new int[10](1, 2); // expected-error {{array 'new' cannot have initialization arguments}}
261 (void)new T(1, 2); // expected-error {{array 'new' cannot have initialization arguments}}
266 (void)new T[1](i); // expected-error {{array 'new' cannot have initialization arguments}}
271 (void)new T(i); // expected-error {{array 'new' cannot have initialization arguments}}
281 void* operator new(size_t);
285 void* operator new(size_t, void*); // expected-note {{declared private here}}
289 void* operator new(size_t); // expected-note {{declared private here}}
296 (void)new S1();
297 (void)new (0L) S1(); // expected-error {{is a private member}}
298 (void)new S2(); // expected-error {{is a private member}}
317 return new (int[T::value]); // expected-warning{{when type is in parentheses, array cannot have dynamic size}}
352 void* operator new(const size_t size);
353 template<class T> void* operator new(const size_t, const int, T*);
371 // the unexpected placement 'operator new'.
375 void *operator new(size_t s, double d = 0);
383 return new A<int>();
389 new DoesNotExist; // expected-error {{unknown type name 'DoesNotExist'}}
397 return new B[5]; // expected-note {{implicit destructor for 'ArrayNewNeedsDtor::B' first required here}}
421 inline void *operator new[](size_t, const PlacementArg &) throw () {
432 S() { new Inner[1]; }
440 new (*(PlacementArg*)0) T[1];
458 CopyCounter* f = new CopyCounter[10](CopyCounter()); // expected-error {{cannot have initialization arguments}}
468 Foo() : a_(new scoped_array<int>[5]) { }
478 Foo2() : a_(new scoped_array2<int>[5]) { }
492 new MessageLoop;