Lines Matching defs:allocator

7   void *p = NEW(sizeof(int)); // expected-note {{cannot allocate untyped memory in a constant expression; use 'std::allocator<T>::allocate'}}
15 template<typename T> struct allocator {
20 DELETE(p); // #dealloc expected-note 2{{'std::allocator<...>::deallocate' used to delete pointer to object allocated with 'new'}}
26 std::allocator<int> alloc;
33 template<> struct std::allocator<void()> {
36 constexpr void *fn = std::allocator<void()>().allocate(); // expected-error {{constant expression}} expected-note {{in call}}
39 template<> struct std::allocator<Incomplete> {
42 constexpr void *incomplete = std::allocator<Incomplete>().allocate(); // expected-error {{constant expression}} expected-note {{in call}}
46 template<> struct std::allocator<WrongSize> {
49 constexpr void *wrong_size = std::allocator<WrongSize>().allocate(); // expected-error {{constant expression}} expected-note {{in call}}
61 p = std::allocator<int>().allocate(1); // expected-note 2{{heap allocation}}
66 delete p; // expected-note {{'delete' used to delete pointer to object allocated with 'std::allocator<...>::allocate'}}
69 delete[] p; // expected-note {{'delete' used to delete pointer to object allocated with 'std::allocator<...>::allocate'}}
72 std::allocator<int>().deallocate(p); // expected-note 2{{in call}}
83 constexpr int *escape = std::allocator<int>().allocate(3); // expected-error {{constant expression}} expected-note {{pointer to subobject of heap-allocated}} \
85 constexpr int leak = (std::allocator<int>().allocate(3), 0); // expected-error {{constant expression}} \
87 constexpr int no_lifetime_start = (*std::allocator<int>().allocate(1) = 1); // expected-error {{constant expression}} expected-note {{assignment to object outside its lifetime}}
88 constexpr int no_deallocate_nullptr = (std::allocator<int>().deallocate(nullptr), 1); // expected-error {{constant expression}} expected-note {{in call}}
89 // expected-note@#dealloc {{'std::allocator<...>::deallocate' used to delete a null pointer}}
90 constexpr int no_deallocate_nonalloc = (std::allocator<int>().deallocate((int*)&no_deallocate_nonalloc), 1); // expected-error {{constant expression}} expected-note {{in call}}
119 int *p = std::allocator<int>().allocate(3);
124 std::allocator<int>().deallocate(p);
210 std::allocator<A> alloc;